diff options
author | Nick Clifton <nickc@cygnus.com> | 2000-04-25 21:10:26 +0000 |
---|---|---|
committer | Nick Clifton <nickc@gcc.gnu.org> | 2000-04-25 21:10:26 +0000 |
commit | b36f4ed35411cadef7f3b17cab4089be7246707a (patch) | |
tree | 66352391a75daac1edb0b4115f2fae562f8b2e8e /gcc/integrate.c | |
parent | 119d24d17a770d4a535c5da3897469d1c7dba354 (diff) | |
download | gcc-b36f4ed35411cadef7f3b17cab4089be7246707a.zip gcc-b36f4ed35411cadef7f3b17cab4089be7246707a.tar.gz gcc-b36f4ed35411cadef7f3b17cab4089be7246707a.tar.bz2 |
Define FUNCTION_ATTRIBUTE_INLINABLE_P, a target macro to allow functions with
target specific attributes to be inlined.
From-SVN: r33421
Diffstat (limited to 'gcc/integrate.c')
-rw-r--r-- | gcc/integrate.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/gcc/integrate.c b/gcc/integrate.c index cfcee1b..6fa0be1 100644 --- a/gcc/integrate.c +++ b/gcc/integrate.c @@ -62,6 +62,12 @@ extern struct obstack *function_maybepermanent_obstack; ? (1 + (3 * list_length (DECL_ARGUMENTS (DECL))) / 2) \ : (8 * (8 + list_length (DECL_ARGUMENTS (DECL))))) #endif + +/* Decide whether a function with a target specific attribute + attached can be inlined. By default we disallow this. */ +#ifndef FUNCTION_ATTRIBUTE_INLINABLE_P +#define FUNCTION_ATTRIBUTE_INLINABLE_P(FNDECL) 0 +#endif static rtvec initialize_for_inline PARAMS ((tree)); static void note_modified_parmregs PARAMS ((rtx, rtx, void *)); @@ -240,7 +246,14 @@ function_cannot_inline_p (fndecl) if (result && GET_CODE (result) == PARALLEL) return N_("inline functions not supported for this return value type"); - return 0; + /* If the function has a target specific attribute attached to it, + then we assume that we should not inline it. This can be overriden + by the target if it defines FUNCTION_ATTRIBUTE_INLINABLE_P. */ + if (DECL_MACHINE_ATTRIBUTES (fndecl) + && ! FUNCTION_ATTRIBUTE_INLINABLE_P (fndecl)) + return N_("function with target specific attribute(s) cannot be inlined"); + + return NULL; } /* Map pseudo reg number into the PARM_DECL for the parm living in the reg. |