aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
authorLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2018-06-03 23:07:42 +0200
committerLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2018-06-12 17:55:11 +0200
commit7c929e1a969c9488745ccbd71c5a825ed8f4bec4 (patch)
treeec49d4961cf5fde7695555dd005b701d2654efd1
parent7304b37ab691460377310190099a4db42c8d139f (diff)
downloadsparse-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.c5
-rw-r--r--lib.c19
2 files changed, 5 insertions, 19 deletions
diff --git a/builtin.c b/builtin.c
index 7f9ff358..b409a775 100644
--- a/builtin.c
+++ b/builtin.c
@@ -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);
}
diff --git a/lib.c b/lib.c
index e86a6045..8bad856e 100644
--- a/lib.c
+++ b/lib.c
@@ -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();