aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
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/cp
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/cp')
-rw-r--r--gcc/cp/ChangeLog10
-rw-r--r--gcc/cp/cp-tree.h8
-rw-r--r--gcc/cp/decl.c11
-rw-r--r--gcc/cp/decl2.c3
-rw-r--r--gcc/cp/optimize.c1
5 files changed, 14 insertions, 19 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 737a97c..4cc62ac 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,13 @@
+2003-08-05 Steven Bosscher <steven@gcc.gnu.org>
+
+ * 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.
+
2003-08-04 Roger Sayle <roger@eyesopen.com>
* decl.c (cxx_insert_default_attributes): Delete.
diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h
index ffae1bf..36dda85 100644
--- a/gcc/cp/cp-tree.h
+++ b/gcc/cp/cp-tree.h
@@ -1637,8 +1637,6 @@ struct lang_type GTY(())
struct lang_decl_flags GTY(())
{
- struct c_lang_decl base;
-
ENUM_BITFIELD(languages) language : 8;
unsigned operator_attr : 1;
@@ -2849,12 +2847,6 @@ struct lang_decl GTY(())
/* We know what we're doing with this decl now. */
#define DECL_INTERFACE_KNOWN(NODE) DECL_LANG_FLAG_5 (NODE)
-/* This function was declared inline. 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) \
- (DECL_LANG_SPECIFIC (NODE)->decl_flags.base.declared_inline)
-
/* DECL_EXTERNAL must be set on a decl until the decl is actually emitted,
so that assemble_external will work properly. So we have this flag to
tell us whether the decl is really not external. */
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index 6bd5c86..503a635 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -8885,19 +8885,14 @@ grokfndecl (tree ctype,
DECL_NOT_REALLY_EXTERN (decl) = 1;
}
- DID_INLINE_FUNC (decl) = 0;
/* If the declaration was declared inline, mark it as such. */
if (inlinep)
DECL_DECLARED_INLINE_P (decl) = 1;
/* We inline functions that are explicitly declared inline, or, when
the user explicitly asks us to, all functions. */
- if (DECL_DECLARED_INLINE_P (decl))
+ if (DECL_DECLARED_INLINE_P (decl)
+ || (flag_inline_trees == 2 && !DECL_INLINE (decl) && funcdef_flag))
DECL_INLINE (decl) = 1;
- if (flag_inline_trees == 2 && !DECL_INLINE (decl) && funcdef_flag)
- {
- DID_INLINE_FUNC (decl) = 1;
- DECL_INLINE (decl) = 1;
- }
DECL_EXTERNAL (decl) = 1;
if (quals != NULL_TREE && TREE_CODE (type) == FUNCTION_TYPE)
@@ -14248,8 +14243,6 @@ start_method (tree declspecs, tree declarator, tree attrlist)
check_template_shadow (fndecl);
DECL_DECLARED_INLINE_P (fndecl) = 1;
-
- DID_INLINE_FUNC (fndecl) = 0;
if (flag_default_inline)
DECL_INLINE (fndecl) = 1;
diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c
index 8ec34b2..46c4083 100644
--- a/gcc/cp/decl2.c
+++ b/gcc/cp/decl2.c
@@ -1743,7 +1743,8 @@ import_export_decl (tree decl)
if ((DECL_IMPLICIT_INSTANTIATION (decl)
|| DECL_FRIEND_PSEUDO_TEMPLATE_INSTANTIATION (decl))
&& (flag_implicit_templates
- || (flag_implicit_inline_templates
+ || (flag_implicit_inline_templates
+ && TREE_CODE (decl) == FUNCTION_DECL
&& DECL_DECLARED_INLINE_P (decl))))
{
if (!TREE_PUBLIC (decl))
diff --git a/gcc/cp/optimize.c b/gcc/cp/optimize.c
index c52970f..4cb5c69 100644
--- a/gcc/cp/optimize.c
+++ b/gcc/cp/optimize.c
@@ -159,7 +159,6 @@ maybe_clone_body (tree fn)
/* Update CLONE's source position information to match FN's. */
DECL_SOURCE_LOCATION (clone) = DECL_SOURCE_LOCATION (fn);
DECL_INLINE (clone) = DECL_INLINE (fn);
- DID_INLINE_FUNC (clone) = DID_INLINE_FUNC (fn);
DECL_DECLARED_INLINE_P (clone) = DECL_DECLARED_INLINE_P (fn);
DECL_COMDAT (clone) = DECL_COMDAT (fn);
DECL_WEAK (clone) = DECL_WEAK (fn);