diff options
author | espindola <espindola@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-04-02 12:03:48 +0000 |
---|---|---|
committer | espindola <espindola@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-04-02 12:03:48 +0000 |
commit | 1c47b3e821b29e2adcda99cba59317133b2dd6f0 (patch) | |
tree | ada50fd14e79e9d014f08296118dd44ba72f361a /gcc/builtins.c | |
parent | 42aaa915ab64d4172abbfb690079c4b81fc0fb19 (diff) | |
download | gcc-1c47b3e821b29e2adcda99cba59317133b2dd6f0.tar.gz |
2009-04-02 Rafael Avila de Espindola <espindola@google.com>
* builtins.c (is_builtin_name): New.
(called_as_built_in): Use is_builtin_name.
* tree.h (is_builtin_name): New.
* varasm.c (incorporeal_function_p): Use is_builtin_name
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@145444 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/builtins.c')
-rw-r--r-- | gcc/builtins.c | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/gcc/builtins.c b/gcc/builtins.c index e22c5f58964..9f0f4ac4fba 100644 --- a/gcc/builtins.c +++ b/gcc/builtins.c @@ -241,13 +241,9 @@ static tree do_mpfr_bessel_n (tree, tree, tree, static tree do_mpfr_remquo (tree, tree, tree); static tree do_mpfr_lgamma_r (tree, tree, tree); -/* Return true if NODE should be considered for inline expansion regardless - of the optimization level. This means whenever a function is invoked with - its "internal" name, which normally contains the prefix "__builtin". */ - -static bool called_as_built_in (tree node) +bool +is_builtin_name (const char *name) { - const char *name = IDENTIFIER_POINTER (DECL_NAME (node)); if (strncmp (name, "__builtin_", 10) == 0) return true; if (strncmp (name, "__sync_", 7) == 0) @@ -255,6 +251,20 @@ static bool called_as_built_in (tree node) return false; } +/* Return true if NODE should be considered for inline expansion regardless + of the optimization level. This means whenever a function is invoked with + its "internal" name, which normally contains the prefix "__builtin". */ + +static bool +called_as_built_in (tree node) +{ + /* Note that we must use DECL_NAME, not DECL_ASSEMBLER_NAME_SET_P since + we want the name used to call the function, not the name it + will have. */ + const char *name = IDENTIFIER_POINTER (DECL_NAME (node)); + return is_builtin_name (name); +} + /* Return the alignment in bits of EXP, an object. Don't return more than MAX_ALIGN no matter what, ALIGN is the inital guessed alignment e.g. from type alignment. */ |