mirror of
git://gcc.gnu.org/git/gcc.git
synced 2024-12-18 03:58:56 +08:00
Define FUNCTION_ATTRIBUTE_INLINABLE_P, a target macro to allow functions with
target specific attributes to be inlined. From-SVN: r33421
This commit is contained in:
parent
119d24d17a
commit
b36f4ed354
@ -1,3 +1,16 @@
|
||||
2000-04-25 Nick Clifton <nickc@cygnus.com>
|
||||
|
||||
* integrate.c (FUNCTION_ATTRIBUTE_INLINABLE_P): If not
|
||||
defined, define to return zero.
|
||||
(function_cannot_inline_p): If a function has any target
|
||||
specific attributes, then use the macro
|
||||
FUNCTION_ATTRIBUTE_INLINABLE_P to allow the target to decide
|
||||
whether it can be inlined. If it cannot, issue a suitable
|
||||
explanation.
|
||||
|
||||
* tm.texi: Add a new node 'Inlining' to document the new macro
|
||||
FUNCTION_ATTRIBUTE_INLINABLE_P.
|
||||
|
||||
2000-04-25 Zack Weinberg <zack@wolery.cumb.org>
|
||||
|
||||
* cpplib.h (struct cpp_buffer): Add 'mapped' flag; fix
|
||||
|
@ -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.
|
||||
|
12
gcc/tm.texi
12
gcc/tm.texi
@ -2169,6 +2169,7 @@ This describes the stack layout and calling conventions.
|
||||
* Caller Saves::
|
||||
* Function Entry::
|
||||
* Profiling::
|
||||
* Inlining::
|
||||
@end menu
|
||||
|
||||
@node Frame Layout
|
||||
@ -3671,6 +3672,17 @@ A C function or functions which are needed in the library to
|
||||
support block profiling.
|
||||
@end table
|
||||
|
||||
@node Inlining
|
||||
@subsection Permitting inlining of functions with attributes
|
||||
@cindex inlining
|
||||
|
||||
By default if a function has a target specific attribute attached to it,
|
||||
it will not be inlined. This behaviour can be overridden if the target
|
||||
defines the @samp{FUNCTION_ATTRIBUTE_INLINABLE_P} macro. This macro
|
||||
takes one argument, a @samp{DECL} describing the function. It should
|
||||
return non-zero if the function can be inlined, otherwise it should
|
||||
return 0.
|
||||
|
||||
@node Varargs
|
||||
@section Implementing the Varargs Macros
|
||||
@cindex varargs implementation
|
||||
|
Loading…
Reference in New Issue
Block a user