keyword: add a comment about NS_TYPEDEF & reserved keywords
[smatch.git] / ident-list.h
blob709ffce01ed675cf3b8f6f51887ddedf7d69feb9
2 #define IDENT(n) __IDENT(n## _ident, #n, 0)
3 #define IDENT_RESERVED(n) __IDENT(n## _ident, #n, 1)
5 /* Basic C reserved words.. */
6 IDENT_RESERVED(sizeof);
7 IDENT_RESERVED(if);
8 IDENT_RESERVED(else);
9 IDENT_RESERVED(return);
10 IDENT_RESERVED(switch);
11 IDENT_RESERVED(case);
12 IDENT_RESERVED(default);
13 IDENT_RESERVED(break);
14 IDENT_RESERVED(continue);
15 IDENT_RESERVED(for);
16 IDENT_RESERVED(while);
17 IDENT_RESERVED(do);
18 IDENT_RESERVED(goto);
20 /* C typenames. They get marked as reserved when initialized */
21 IDENT(struct);
22 IDENT(union);
23 IDENT(enum);
24 IDENT(__attribute); IDENT(__attribute__);
25 IDENT(volatile); IDENT(__volatile); IDENT(__volatile__);
26 IDENT(double);
28 /* C storage classes. They get marked as reserved when initialized */
29 IDENT(static);
31 /* C99 keywords */
32 IDENT(restrict); IDENT(__restrict); IDENT(__restrict__);
33 IDENT(_Bool);
34 IDENT_RESERVED(_Complex);
35 IDENT_RESERVED(_Imaginary);
37 /* C11 keywords */
38 IDENT(_Alignas);
39 IDENT_RESERVED(_Alignof);
40 IDENT_RESERVED(_Atomic);
41 IDENT_RESERVED(_Generic);
42 IDENT(_Noreturn);
43 IDENT_RESERVED(_Static_assert);
44 IDENT(_Thread_local);
46 /* Special case for L'\t' */
47 IDENT(L);
49 /* Extended gcc identifiers */
50 IDENT(asm); IDENT_RESERVED(__asm); IDENT_RESERVED(__asm__);
51 IDENT(alignof); IDENT_RESERVED(__alignof); IDENT_RESERVED(__alignof__);
52 IDENT_RESERVED(__sizeof_ptr__);
53 IDENT_RESERVED(__builtin_types_compatible_p);
54 IDENT_RESERVED(__builtin_offsetof);
55 IDENT_RESERVED(__label__);
57 /* Attribute names */
58 IDENT(packed); IDENT(__packed__);
59 IDENT(aligned); IDENT(__aligned__);
60 IDENT(nocast);
61 IDENT(noderef);
62 IDENT(safe);
63 IDENT(force);
64 IDENT(address_space);
65 IDENT(context);
66 IDENT(mode); IDENT(__mode__);
67 IDENT(QI); IDENT(__QI__);
68 IDENT(HI); IDENT(__HI__);
69 IDENT(SI); IDENT(__SI__);
70 IDENT(DI); IDENT(__DI__);
71 IDENT(word); IDENT(__word__);
72 IDENT(format); IDENT(__format__);
73 IDENT(section); IDENT(__section__);
74 IDENT(unused); IDENT(__unused__);
75 IDENT(const); IDENT(__const); IDENT(__const__);
76 IDENT(used); IDENT(__used__);
77 IDENT(warn_unused_result); IDENT(__warn_unused_result__);
78 IDENT(noinline); IDENT(__noinline__);
79 IDENT(deprecated); IDENT(__deprecated__);
80 IDENT(noreturn); IDENT(__noreturn__);
81 IDENT(regparm); IDENT(__regparm__);
82 IDENT(weak); IDENT(__weak__);
83 IDENT(no_instrument_function); IDENT(__no_instrument_function__);
84 IDENT(sentinel); IDENT(__sentinel__);
85 IDENT(alias); IDENT(__alias__);
86 IDENT(pure); IDENT(__pure__);
87 IDENT(always_inline); IDENT(__always_inline__);
88 IDENT(syscall_linkage); IDENT(__syscall_linkage__);
89 IDENT(visibility); IDENT(__visibility__);
90 IDENT(bitwise); IDENT(__bitwise__);
91 IDENT(model); IDENT(__model__);
92 IDENT(format_arg); IDENT(__format_arg__);
93 IDENT(nothrow); IDENT(__nothrow); IDENT(__nothrow__);
94 IDENT(__transparent_union__);
95 IDENT(malloc);
96 IDENT(__malloc__);
97 IDENT(nonnull); IDENT(__nonnull); IDENT(__nonnull__);
98 IDENT(constructor); IDENT(__constructor__);
99 IDENT(destructor); IDENT(__destructor__);
100 IDENT(cold); IDENT(__cold__);
101 IDENT(hot); IDENT(__hot__);
102 IDENT(cdecl); IDENT(__cdecl__);
103 IDENT(stdcall); IDENT(__stdcall__);
104 IDENT(fastcall); IDENT(__fastcall__);
105 IDENT(dllimport); IDENT(__dllimport__);
106 IDENT(dllexport); IDENT(__dllexport__);
107 IDENT(artificial); IDENT(__artificial__);
108 IDENT(leaf); IDENT(__leaf__);
109 IDENT(vector_size); IDENT(__vector_size__);
110 IDENT(error); IDENT(__error__);
113 /* Preprocessor idents. Direct use of __IDENT avoids mentioning the keyword
114 * itself by name, preventing these tokens from expanding when compiling
115 * sparse. */
116 IDENT(defined);
117 IDENT(once);
118 __IDENT(pragma_ident, "__pragma__", 0);
119 __IDENT(__VA_ARGS___ident, "__VA_ARGS__", 0);
120 __IDENT(__LINE___ident, "__LINE__", 0);
121 __IDENT(__FILE___ident, "__FILE__", 0);
122 __IDENT(__DATE___ident, "__DATE__", 0);
123 __IDENT(__TIME___ident, "__TIME__", 0);
124 __IDENT(__func___ident, "__func__", 0);
125 __IDENT(__FUNCTION___ident, "__FUNCTION__", 0);
126 __IDENT(__PRETTY_FUNCTION___ident, "__PRETTY_FUNCTION__", 0);
127 __IDENT(__COUNTER___ident, "__COUNTER__", 0);
129 /* Sparse commands */
130 IDENT_RESERVED(__context__);
131 IDENT_RESERVED(__range__);
133 /* Magic function names we recognize */
134 IDENT(memset); IDENT(memcpy);
135 IDENT(copy_to_user); IDENT(copy_from_user);
136 IDENT(main);
138 #undef __IDENT
139 #undef IDENT
140 #undef IDENT_RESERVED