diff options
| author | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2018-06-03 23:07:42 +0200 |
|---|---|---|
| committer | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2018-06-12 17:55:11 +0200 |
| commit | 7c929e1a969c9488745ccbd71c5a825ed8f4bec4 (patch) | |
| tree | ec49d4961cf5fde7695555dd005b701d2654efd1 | |
| parent | 7304b37ab691460377310190099a4db42c8d139f (diff) | |
| download | sparse-dev-7c929e1a969c9488745ccbd71c5a825ed8f4bec4.tar.gz | |
builtin: merge declare_builtin_function() with declare_builtins()
declare_builtin_functions() contained only the declaration of 3
(Blackfin specific) builtin functions.
Move these to declare_builtins() where all other builtins are declared.
Note: these builtin are were declared on the condition that '__bfin__'
was defined and now are unconditionally declared. It's fine,
the builtins for alpha are also always declared here.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
| -rw-r--r-- | builtin.c | 5 | ||||
| -rw-r--r-- | lib.c | 19 |
2 files changed, 5 insertions, 19 deletions
@@ -459,4 +459,9 @@ void declare_builtins(void) declare_builtin("__sync_synchronize", &void_ctype, 0, NULL); declare_builtin("__sync_val_compare_and_swap", &int_ctype, 1, &ptr_ctype, NULL); declare_builtin("__sync_xor_and_fetch", &int_ctype, 1, &ptr_ctype, NULL); + + // Blackfin-specific stuff + declare_builtin("__builtin_bfin_csync", &void_ctype, 0, NULL); + declare_builtin("__builtin_bfin_ssync", &void_ctype, 0, NULL); + declare_builtin("__builtin_bfin_norm_fr1x32", &int_ctype, 0, &int_ctype, NULL); } @@ -1214,23 +1214,6 @@ static void predefined_macros(void) predefine("__pragma__", 0, NULL); } -static void declare_builtin_functions(void) -{ - /* Note: - * Most builtin functions are declared in builtin.c:declare_builtins(). - * Some are also defined in builtin:init_builtins(). - */ - - /* Add Blackfin-specific stuff */ - add_pre_buffer( - "#ifdef __bfin__\n" - "extern void __builtin_bfin_csync(void);\n" - "extern void __builtin_bfin_ssync(void);\n" - "extern int __builtin_bfin_norm_fr1x32(int);\n" - "#endif\n" - ); -} - static void create_builtin_stream(void) { // Temporary hack @@ -1385,8 +1368,6 @@ struct symbol_list *sparse_initialize(int argc, char **argv, struct string_list predefined_macros(); create_builtin_stream(); declare_builtins(); - if (!preprocess_only) - declare_builtin_functions(); list = sparse_initial(); |
