Commit b36f4ed3 by Nick Clifton Committed by Nick Clifton

Define FUNCTION_ATTRIBUTE_INLINABLE_P, a target macro to allow functions with

target specific attributes to be inlined.

From-SVN: r33421
parent 119d24d1
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> 2000-04-25 Zack Weinberg <zack@wolery.cumb.org>
* cpplib.h (struct cpp_buffer): Add 'mapped' flag; fix * cpplib.h (struct cpp_buffer): Add 'mapped' flag; fix
......
...@@ -62,6 +62,12 @@ extern struct obstack *function_maybepermanent_obstack; ...@@ -62,6 +62,12 @@ extern struct obstack *function_maybepermanent_obstack;
? (1 + (3 * list_length (DECL_ARGUMENTS (DECL))) / 2) \ ? (1 + (3 * list_length (DECL_ARGUMENTS (DECL))) / 2) \
: (8 * (8 + list_length (DECL_ARGUMENTS (DECL))))) : (8 * (8 + list_length (DECL_ARGUMENTS (DECL)))))
#endif #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 rtvec initialize_for_inline PARAMS ((tree));
static void note_modified_parmregs PARAMS ((rtx, rtx, void *)); static void note_modified_parmregs PARAMS ((rtx, rtx, void *));
...@@ -240,7 +246,14 @@ function_cannot_inline_p (fndecl) ...@@ -240,7 +246,14 @@ function_cannot_inline_p (fndecl)
if (result && GET_CODE (result) == PARALLEL) if (result && GET_CODE (result) == PARALLEL)
return N_("inline functions not supported for this return value type"); 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. /* Map pseudo reg number into the PARM_DECL for the parm living in the reg.
......
...@@ -2169,6 +2169,7 @@ This describes the stack layout and calling conventions. ...@@ -2169,6 +2169,7 @@ This describes the stack layout and calling conventions.
* Caller Saves:: * Caller Saves::
* Function Entry:: * Function Entry::
* Profiling:: * Profiling::
* Inlining::
@end menu @end menu
@node Frame Layout @node Frame Layout
...@@ -3671,6 +3672,17 @@ A C function or functions which are needed in the library to ...@@ -3671,6 +3672,17 @@ A C function or functions which are needed in the library to
support block profiling. support block profiling.
@end table @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 @node Varargs
@section Implementing the Varargs Macros @section Implementing the Varargs Macros
@cindex varargs implementation @cindex varargs implementation
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment