From b3c3af2f63dac9ca424ea3c1a456ef689159d3ae Mon Sep 17 00:00:00 2001 From: Steven Bosscher Date: Tue, 5 Aug 2003 14:11:53 +0000 Subject: tree.h (DID_INLINE_FUNC): Remove macro. 2003-08-05 Steven Bosscher * 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 --- gcc/tree.h | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) (limited to 'gcc/tree.h') diff --git a/gcc/tree.h b/gcc/tree.h index c8a71e5..cac3efc 100644 --- a/gcc/tree.h +++ b/gcc/tree.h @@ -1473,10 +1473,12 @@ struct tree_type GTY(()) where it is called. */ #define DECL_INLINE(NODE) (FUNCTION_DECL_CHECK (NODE)->decl.inline_flag) -/* Nonzero in a FUNCTION_DECL means this function has been found inlinable - only by virtue of -finline-functions */ -#define DID_INLINE_FUNC(NODE) \ - (FUNCTION_DECL_CHECK (NODE)->decl.inlined_function_flag) +/* Nonzero in a FUNCTION_DECL means that this function was declared inline, + such as via the `inline' keyword in C/C++. This flag controls the linkage + semantics of 'inline'; whether or not the function is inlined is + controlled by DECL_INLINE. */ +#define DECL_DECLARED_INLINE_P(NODE) \ + (FUNCTION_DECL_CHECK (NODE)->decl.declared_inline_flag) /* In a FUNCTION_DECL, nonzero if the function cannot be inlined. */ #define DECL_UNINLINABLE(NODE) (FUNCTION_DECL_CHECK (NODE)->decl.uninlinable) @@ -1606,6 +1608,13 @@ struct tree_type GTY(()) #define DECL_POINTER_ALIAS_SET_KNOWN_P(NODE) \ (DECL_POINTER_ALIAS_SET (NODE) != - 1) +/* In a FUNCTION_DECL for which DECL_BUILT_IN does not hold, this is + the approximate number of statements in this function. There is + no need for this number to be exact; it is only used in various + heuristics regarding optimization. */ +#define DECL_ESTIMATED_INSNS(NODE) \ + (FUNCTION_DECL_CHECK (NODE)->decl.u1.i) + struct function; struct tree_decl GTY(()) @@ -1646,7 +1655,7 @@ struct tree_decl GTY(()) unsigned user_align : 1; unsigned uninlinable : 1; unsigned thread_local_flag : 1; - unsigned inlined_function_flag : 1; + unsigned declared_inline_flag : 1; unsigned unused : 3; /* three unused bits. */ -- cgit v1.1