Unified · Split
| @@ -1,66 +1,124 @@ | ||
| 1 | −DEF(TOK___LINE__, "__LINE__") | |
| 2 | −DEF(TOK___FILE__, "__FILE__") | |
| 3 | −DEF(TOK___DATE__, "__DATE__") | |
| 4 | −DEF(TOK___TIME__, "__TIME__") | |
| 5 | −DEF(TOK___FUNCTION__, "__FUNCTION__") | |
| 6 | −DEF(TOK___VA_ARGS__, "__VA_ARGS__") | |
| 1 | +/* keywords */ | |
| 2 | + DEF(TOK_INT, "int") | |
| 3 | + DEF(TOK_VOID, "void") | |
| 4 | + DEF(TOK_CHAR, "char") | |
| 5 | + DEF(TOK_IF, "if") | |
| 6 | + DEF(TOK_ELSE, "else") | |
| 7 | + DEF(TOK_WHILE, "while") | |
| 8 | + DEF(TOK_BREAK, "break") | |
| 9 | + DEF(TOK_RETURN, "return") | |
| 10 | + DEF(TOK_FOR, "for") | |
| 11 | + DEF(TOK_EXTERN, "extern") | |
| 12 | + DEF(TOK_STATIC, "static") | |
| 13 | + DEF(TOK_UNSIGNED, "unsigned") | |
| 14 | + DEF(TOK_GOTO, "goto") | |
| 15 | + DEF(TOK_DO, "do") | |
| 16 | + DEF(TOK_CONTINUE, "continue") | |
| 17 | + DEF(TOK_SWITCH, "switch") | |
| 18 | + DEF(TOK_CASE, "case") | |
| 7 | 19 | |
| 8 | −/* special identifiers */ | |
| 9 | −DEF(TOK___FUNC__, "__func__") | |
| 20 | + /* ignored types Must have contiguous values */ | |
| 21 | + DEF(TOK_CONST, "const") | |
| 22 | + DEF(TOK_VOLATILE, "volatile") | |
| 23 | + DEF(TOK_LONG, "long") | |
| 24 | + DEF(TOK_REGISTER, "register") | |
| 25 | + DEF(TOK_SIGNED, "signed") | |
| 26 | + DEF(TOK___SIGNED__, "__signed__") /* gcc keyword */ | |
| 27 | + DEF(TOK_AUTO, "auto") | |
| 28 | + DEF(TOK_INLINE, "inline") | |
| 29 | + DEF(TOK___INLINE__, "__inline__") /* gcc keyword */ | |
| 30 | + DEF(TOK_RESTRICT, "restrict") | |
| 31 | + | |
| 32 | + DEF(TOK_FLOAT, "float") | |
| 33 | + DEF(TOK_DOUBLE, "double") | |
| 34 | + DEF(TOK_BOOL, "_Bool") | |
| 35 | + DEF(TOK_SHORT, "short") | |
| 36 | + DEF(TOK_STRUCT, "struct") | |
| 37 | + DEF(TOK_UNION, "union") | |
| 38 | + DEF(TOK_TYPEDEF, "typedef") | |
| 39 | + DEF(TOK_DEFAULT, "default") | |
| 40 | + DEF(TOK_ENUM, "enum") | |
| 41 | + DEF(TOK_SIZEOF, "sizeof") | |
| 42 | + DEF(TOK___ATTRIBUTE__, "__attribute__") | |
| 43 | + DEF(TOK_ALIGNOF, "__alignof__") | |
| 44 | + DEF(TOK_TYPEOF, "typeof") | |
| 10 | 45 | |
| 46 | +/*********************************************************************/ | |
| 47 | +/* the following are not keywords. They are included to ease parsing */ | |
| 48 | +/* preprocessor only */ | |
| 49 | + DEF(TOK_DEFINE, "define") | |
| 50 | + DEF(TOK_INCLUDE, "include") | |
| 51 | + DEF(TOK_IFDEF, "ifdef") | |
| 52 | + DEF(TOK_IFNDEF, "ifndef") | |
| 53 | + DEF(TOK_ELIF, "elif") | |
| 54 | + DEF(TOK_ENDIF, "endif") | |
| 55 | + DEF(TOK_DEFINED, "defined") | |
| 56 | + DEF(TOK_UNDEF, "undef") | |
| 57 | + DEF(TOK_ERROR, "error") | |
| 58 | + DEF(TOK_LINE, "line") | |
| 59 | + DEF(TOK___LINE__, "__LINE__") | |
| 60 | + DEF(TOK___FILE__, "__FILE__") | |
| 61 | + DEF(TOK___DATE__, "__DATE__") | |
| 62 | + DEF(TOK___TIME__, "__TIME__") | |
| 63 | + DEF(TOK___FUNCTION__, "__FUNCTION__") | |
| 64 | + DEF(TOK___VA_ARGS__, "__VA_ARGS__") | |
| 65 | + | |
| 66 | +/* special identifiers */ | |
| 67 | + DEF(TOK___FUNC__, "__func__") | |
| 68 | + | |
| 11 | 69 | /* attribute identifiers */ |
| 12 | −DEF(TOK_SECTION, "section") | |
| 13 | −DEF(TOK___SECTION__, "__section__") | |
| 14 | −DEF(TOK_ALIGNED, "aligned") | |
| 15 | −DEF(TOK___ALIGNED__, "__aligned__") | |
| 16 | −DEF(TOK_UNUSED, "unused") | |
| 17 | −DEF(TOK___UNUSED__, "__unused__") | |
| 18 | −DEF(TOK_CDECL, "cdecl") | |
| 19 | −DEF(TOK___CDECL, "__cdecl") | |
| 20 | −DEF(TOK___CDECL__, "__cdecl__") | |
| 21 | −DEF(TOK_STDCALL, "stdcall") | |
| 22 | −DEF(TOK___STDCALL, "__stdcall") | |
| 23 | −DEF(TOK___STDCALL__, "__stdcall__") | |
| 24 | −DEF(TOK_NORETURN, "noreturn") | |
| 25 | −DEF(TOK___NORETURN__, "__noreturn__") | |
| 70 | + DEF(TOK_SECTION, "section") | |
| 71 | + DEF(TOK___SECTION__, "__section__") | |
| 72 | + DEF(TOK_ALIGNED, "aligned") | |
| 73 | + DEF(TOK___ALIGNED__, "__aligned__") | |
| 74 | + DEF(TOK_UNUSED, "unused") | |
| 75 | + DEF(TOK___UNUSED__, "__unused__") | |
| 76 | + DEF(TOK_CDECL, "cdecl") | |
| 77 | + DEF(TOK___CDECL, "__cdecl") | |
| 78 | + DEF(TOK___CDECL__, "__cdecl__") | |
| 79 | + DEF(TOK_STDCALL, "stdcall") | |
| 80 | + DEF(TOK___STDCALL, "__stdcall") | |
| 81 | + DEF(TOK___STDCALL__, "__stdcall__") | |
| 82 | + DEF(TOK_NORETURN, "noreturn") | |
| 83 | + DEF(TOK___NORETURN__, "__noreturn__") | |
| 26 | 84 | |
| 27 | 85 | /* builtin functions or variables */ |
| 28 | −DEF(TOK_memcpy, "memcpy") | |
| 29 | −DEF(TOK_memset, "memset") | |
| 30 | −DEF(TOK_alloca, "alloca") | |
| 31 | −DEF(TOK___divdi3, "__divdi3") | |
| 32 | −DEF(TOK___moddi3, "__moddi3") | |
| 33 | −DEF(TOK___udivdi3, "__udivdi3") | |
| 34 | −DEF(TOK___umoddi3, "__umoddi3") | |
| 35 | −DEF(TOK___sardi3, "__sardi3") | |
| 36 | −DEF(TOK___shrdi3, "__shrdi3") | |
| 37 | −DEF(TOK___shldi3, "__shldi3") | |
| 38 | −DEF(TOK___tcc_int_fpu_control, "__tcc_int_fpu_control") | |
| 39 | −DEF(TOK___tcc_fpu_control, "__tcc_fpu_control") | |
| 40 | −DEF(TOK___ulltof, "__ulltof") | |
| 41 | −DEF(TOK___ulltod, "__ulltod") | |
| 42 | −DEF(TOK___ulltold, "__ulltold") | |
| 43 | −DEF(TOK___fixunssfdi, "__fixunssfdi") | |
| 44 | −DEF(TOK___fixunsdfdi, "__fixunsdfdi") | |
| 45 | −DEF(TOK___fixunsxfdi, "__fixunsxfdi") | |
| 86 | + DEF(TOK_memcpy, "memcpy") | |
| 87 | + DEF(TOK_memset, "memset") | |
| 88 | + DEF(TOK_alloca, "alloca") | |
| 89 | + DEF(TOK___divdi3, "__divdi3") | |
| 90 | + DEF(TOK___moddi3, "__moddi3") | |
| 91 | + DEF(TOK___udivdi3, "__udivdi3") | |
| 92 | + DEF(TOK___umoddi3, "__umoddi3") | |
| 93 | + DEF(TOK___sardi3, "__sardi3") | |
| 94 | + DEF(TOK___shrdi3, "__shrdi3") | |
| 95 | + DEF(TOK___shldi3, "__shldi3") | |
| 96 | + DEF(TOK___tcc_int_fpu_control, "__tcc_int_fpu_control") | |
| 97 | + DEF(TOK___tcc_fpu_control, "__tcc_fpu_control") | |
| 98 | + DEF(TOK___ulltof, "__ulltof") | |
| 99 | + DEF(TOK___ulltod, "__ulltod") | |
| 100 | + DEF(TOK___ulltold, "__ulltold") | |
| 101 | + DEF(TOK___fixunssfdi, "__fixunssfdi") | |
| 102 | + DEF(TOK___fixunsdfdi, "__fixunsdfdi") | |
| 103 | + DEF(TOK___fixunsxfdi, "__fixunsxfdi") | |
| 46 | 104 | |
| 47 | 105 | /* bound checking symbols */ |
| 48 | 106 | #ifdef CONFIG_TCC_BCHECK |
| 49 | −DEF(TOK___bound_ptr_add, "__bound_ptr_add") | |
| 50 | −DEF(TOK___bound_ptr_indir1, "__bound_ptr_indir1") | |
| 51 | −DEF(TOK___bound_ptr_indir2, "__bound_ptr_indir2") | |
| 52 | −DEF(TOK___bound_ptr_indir4, "__bound_ptr_indir4") | |
| 53 | −DEF(TOK___bound_ptr_indir8, "__bound_ptr_indir8") | |
| 54 | −DEF(TOK___bound_ptr_indir12, "__bound_ptr_indir12") | |
| 55 | −DEF(TOK___bound_ptr_indir16, "__bound_ptr_indir16") | |
| 56 | −DEF(TOK___bound_local_new, "__bound_local_new") | |
| 57 | −DEF(TOK___bound_local_delete, "__bound_local_delete") | |
| 58 | −DEF(TOK_malloc, "malloc") | |
| 59 | −DEF(TOK_free, "free") | |
| 60 | −DEF(TOK_realloc, "realloc") | |
| 61 | −DEF(TOK_memalign, "memalign") | |
| 62 | −DEF(TOK_calloc, "calloc") | |
| 63 | −DEF(TOK_memmove, "memmove") | |
| 64 | −DEF(TOK_strlen, "strlen") | |
| 65 | −DEF(TOK_strcpy, "strcpy") | |
| 107 | + DEF(TOK___bound_ptr_add, "__bound_ptr_add") | |
| 108 | + DEF(TOK___bound_ptr_indir1, "__bound_ptr_indir1") | |
| 109 | + DEF(TOK___bound_ptr_indir2, "__bound_ptr_indir2") | |
| 110 | + DEF(TOK___bound_ptr_indir4, "__bound_ptr_indir4") | |
| 111 | + DEF(TOK___bound_ptr_indir8, "__bound_ptr_indir8") | |
| 112 | + DEF(TOK___bound_ptr_indir12, "__bound_ptr_indir12") | |
| 113 | + DEF(TOK___bound_ptr_indir16, "__bound_ptr_indir16") | |
| 114 | + DEF(TOK___bound_local_new, "__bound_local_new") | |
| 115 | + DEF(TOK___bound_local_delete, "__bound_local_delete") | |
| 116 | + DEF(TOK_malloc, "malloc") | |
| 117 | + DEF(TOK_free, "free") | |
| 118 | + DEF(TOK_realloc, "realloc") | |
| 119 | + DEF(TOK_memalign, "memalign") | |
| 120 | + DEF(TOK_calloc, "calloc") | |
| 121 | + DEF(TOK_memmove, "memmove") | |
| 122 | + DEF(TOK_strlen, "strlen") | |
| 123 | + DEF(TOK_strcpy, "strcpy") | |
| 66 | 124 | #endif |