aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-decl.c
diff options
context:
space:
mode:
authorSteven Bosscher <steven@gcc.gnu.org>2003-08-05 14:11:53 +0000
committerSteven Bosscher <steven@gcc.gnu.org>2003-08-05 14:11:53 +0000
commitb3c3af2f63dac9ca424ea3c1a456ef689159d3ae (patch)
treef99d1c794a4de2c3fc4751de63ab48b0674a8860 /gcc/c-decl.c
parent158aa0f72ec70e63bd8e4efd3f4edadd2d95f96d (diff)
downloadgcc-b3c3af2f63dac9ca424ea3c1a456ef689159d3ae.zip
gcc-b3c3af2f63dac9ca424ea3c1a456ef689159d3ae.tar.gz
gcc-b3c3af2f63dac9ca424ea3c1a456ef689159d3ae.tar.bz2
tree.h (DID_INLINE_FUNC): Remove macro.
2003-08-05 Steven Bosscher <steven@gcc.gnu.org> * tree.h (DID_INLINE_FUNC): Remove macro. (DECL_DECLARED_INLINE_P): Move from c-tree.h and cp/cp-tree.h, add tree check for FUNCTION_DECL. (DECL_ESTIMATED_INSNS): Move from c-common.h and java/java-tree.h. (struct tree_decl): Rename inlined_function_flag to declared_inline_flag. * c-common.h (c_lang_decl): Remove. (DECL_ESTIMATED_INSNS): Remove. * c-tree.h (struct lang_decl): Don't include c_lang_decl. (DECL_DECLARED_INLINE_P): Remove. * c-decl.c (grokdeclarator): Update comment. With -finline-functions, do not reset DECL_DECLARED_INLINE_P. Don't use DID_INLINE_FUNC. (finish_function): Make uninlinable a bool. Fixup call to tree_inlinable_function_p() and fix some code style issues. * cgraph.h (disgread_inline_limits): Fix spelling: `disregard'. * cgraph.c (dump_cgraph): Likewise. * cgraphunit.c (cgraph_decide_inlining): Likewise (cgraph_finalize_compilation_unit): Likewise. Also update call to tree_inlinable_function_p(). (cgraph_default_inline_p): Don't use DID_INLINE_FUNC. Instead look at DECL_DECLARED_INLINE and reverse logic. * print-tree.c (print_node): Likewise. * toplev.c (rest_of_handle_inlining): Don't use DID_INLINE_FUNC. * tree-inline.h (tree_inlinable_function_p): Make a bool. Update prototype. * tree-inline.c (inlinable_function_p): Split up in this function to check for basic inlining inhibiting conditions, and new limits_allow_inlining() function. Warn if inlining is impossible because the inline candidate calls alloca or uses sjlj exceptions. (limits_allow_inlining): this new function to check if the inlining limits are satisfied. Throttle from currfn_max_inline_insns, not from MAX_INLINE_INSNS_SINGLE. The latter only makes sense if MAX_INLINE_INSNS_AUTO and MAX_INLINE_INSNS_SINGLE are equal. Update prototypes. (tree_inlinable_function_p): Make a bool. Update call to inlinable_function_p (expand_call_inline): Use limits_allow_inlining() when not in unit-at-a-time mode to decide on inlining. Don't use DID_INLINE_FUNC, instead see if the function was declared `inline'. cp/ * cp-tree.h (struct lang_decl): Don't include c_lang_decl. (DECL_DECLARED_INLINE_P): Remove. * decl2.c (import_export_decl): Only look at DECL_DECLARED_INLINE_P if decl is a FUNCTION_DECL. This never made sense, but now it is required to avoid a tree check failure. * decl.c (grokfndecl): Don't touch DID_INLINE_FUNC. * optimize.c (maybe_clone_body): Likewise. java/ * java-tree.h (DECL_ESTIMATED_INSNS): Remove. From-SVN: r70174
Diffstat (limited to 'gcc/c-decl.c')
-rw-r--r--gcc/c-decl.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/gcc/c-decl.c b/gcc/c-decl.c
index 550d6c8..9c6af80 100644
--- a/gcc/c-decl.c
+++ b/gcc/c-decl.c
@@ -4319,7 +4319,7 @@ grokdeclarator (tree declarator, tree declspecs,
}
else if (inlinep)
{
- /* Assume that otherwise the function can be inlined. */
+ /* Record that the function is declared `inline'. */
DECL_DECLARED_INLINE_P (decl) = 1;
/* Do not mark bare declarations as DECL_INLINE. Doing so
@@ -4337,12 +4337,7 @@ grokdeclarator (tree declarator, tree declspecs,
two things: let the function be deferred until it is actually
needed, and let dwarf2 know that the function is inlinable. */
else if (flag_inline_trees == 2 && initialized)
- {
- if (!DECL_INLINE (decl))
- DID_INLINE_FUNC (decl) = 1;
- DECL_INLINE (decl) = 1;
- DECL_DECLARED_INLINE_P (decl) = 0;
- }
+ DECL_INLINE (decl) = 1;
}
else
{
@@ -6157,7 +6152,7 @@ finish_function (int nested, int can_defer_p)
/* Function is parsed.
Generate RTL for the body of this function or defer
it for later expansion. */
- int uninlinable = 1;
+ bool uninlinable = true;
/* There's no reason to do any of the work here if we're only doing
semantic analysis; this code just generates RTL. */
@@ -6174,14 +6169,14 @@ finish_function (int nested, int can_defer_p)
predicates depend on cfun and current_function_decl to
function completely. */
timevar_push (TV_INTEGRATION);
- uninlinable = ! tree_inlinable_function_p (fndecl, 0);
+ uninlinable = !tree_inlinable_function_p (fndecl);
if (can_defer_p
/* We defer functions marked inline *even if* the function
itself is not inlinable. This is because we don't yet
know if the function will actually be used; we may be
able to avoid emitting it entirely. */
- && (! uninlinable || DECL_DECLARED_INLINE_P (fndecl))
+ && (!uninlinable || DECL_DECLARED_INLINE_P (fndecl))
/* Save function tree for inlining. Should return 0 if the
language does not support function deferring or the
function could not be deferred. */