aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2009-08-24 17:32:24 -0400
committerJason Merrill <jason@gcc.gnu.org>2009-08-24 17:32:24 -0400
commit783a452ccebb02b68894a0676af80cd81cc20a88 (patch)
tree5f1db66707ec4b1bdfa82e007c44ad7a3fa8aba0
parentd9fbd03b211d96fa1be5f0576e578dd11ed7bd21 (diff)
downloadgcc-783a452ccebb02b68894a0676af80cd81cc20a88.zip
gcc-783a452ccebb02b68894a0676af80cd81cc20a88.tar.gz
gcc-783a452ccebb02b68894a0676af80cd81cc20a88.tar.bz2
cp-tree.h (DECL_DEFERRED_FN): Remove.
* cp-tree.h (DECL_DEFERRED_FN): Remove. (struct lang_decl_fn): Remove deferred flag. * class.c (build_clone): Don't set it. * decl2.c (note_vague_linkage_fn): Don't check or set it. (mark_used): Don't check it. * method.c (make_thunk, make_alias_for): Don't set it. From-SVN: r151063
-rw-r--r--gcc/cp/ChangeLog7
-rw-r--r--gcc/cp/class.c2
-rw-r--r--gcc/cp/cp-tree.h7
-rw-r--r--gcc/cp/decl2.c29
-rw-r--r--gcc/cp/method.c3
5 files changed, 17 insertions, 31 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index be151df..6c9d217 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,5 +1,12 @@
2009-08-24 Jason Merrill <jason@redhat.com>
+ * cp-tree.h (DECL_DEFERRED_FN): Remove.
+ (struct lang_decl_fn): Remove deferred flag.
+ * class.c (build_clone): Don't set it.
+ * decl2.c (note_vague_linkage_fn): Don't check or set it.
+ (mark_used): Don't check it.
+ * method.c (make_thunk, make_alias_for): Don't set it.
+
* decl2.c (mark_used): Streamline logic.
PR c++/41109
diff --git a/gcc/cp/class.c b/gcc/cp/class.c
index 9a76883..694d262 100644
--- a/gcc/cp/class.c
+++ b/gcc/cp/class.c
@@ -3881,8 +3881,6 @@ build_clone (tree fn, tree name)
/* There's no pending inline data for this function. */
DECL_PENDING_INLINE_INFO (clone) = NULL;
DECL_PENDING_INLINE_P (clone) = 0;
- /* And it hasn't yet been deferred. */
- DECL_DEFERRED_FN (clone) = 0;
/* The base-class destructor is not virtual. */
if (name == base_dtor_identifier)
diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h
index bafe033..ff9ca7b4 100644
--- a/gcc/cp/cp-tree.h
+++ b/gcc/cp/cp-tree.h
@@ -1642,8 +1642,7 @@ struct GTY(()) lang_decl_fn {
unsigned thunk_p : 1;
unsigned this_thunk_p : 1;
unsigned hidden_friend_p : 1;
- unsigned deferred : 1;
- /* No spare bits; consider adding to lang_decl_base instead. */
+ /* 1 spare bit. */
/* For a non-thunk function decl, this is a tree list of
friendly classes. For a thunk function decl, it is the
@@ -2235,10 +2234,6 @@ extern void decl_shadowed_for_var_insert (tree, tree);
#define CLASSTYPE_SORTED_FIELDS(NODE) \
(LANG_TYPE_CLASS_CHECK (NODE)->sorted_fields)
-/* True if on the deferred_fns (see decl2.c) list. */
-#define DECL_DEFERRED_FN(DECL) \
- (LANG_DECL_FN_CHECK (DECL)->deferred)
-
/* If non-NULL for a VAR_DECL, FUNCTION_DECL, TYPE_DECL or
TEMPLATE_DECL, the entity is either a template specialization (if
DECL_USE_TEMPLATE is nonzero) or the abstract instance of the
diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c
index 2ef7a5c..da9c2b7 100644
--- a/gcc/cp/decl2.c
+++ b/gcc/cp/decl2.c
@@ -703,12 +703,8 @@ check_classfn (tree ctype, tree function, tree template_parms)
void
note_vague_linkage_fn (tree decl)
{
- if (!DECL_DEFERRED_FN (decl))
- {
- DECL_DEFERRED_FN (decl) = 1;
- DECL_DEFER_OUTPUT (decl) = 1;
- VEC_safe_push (tree, gc, deferred_fns, decl);
- }
+ DECL_DEFER_OUTPUT (decl) = 1;
+ VEC_safe_push (tree, gc, deferred_fns, decl);
}
/* We have just processed the DECL, which is a static data member.
@@ -3932,21 +3928,9 @@ mark_used (tree decl)
}
if (TREE_CODE (decl) == FUNCTION_DECL && DECL_DECLARED_INLINE_P (decl)
- && !TREE_ASM_WRITTEN (decl))
+ && !DECL_INITIAL (decl) && !DECL_ARTIFICIAL (decl))
/* Remember it, so we can check it was defined. */
- {
- if (DECL_DEFERRED_FN (decl))
- return;
-
- /* Remember the current location for a function we will end up
- synthesizing. Then we can inform the user where it was
- required in the case of error. */
- if (DECL_ARTIFICIAL (decl) && DECL_NONSTATIC_MEMBER_FUNCTION_P (decl)
- && !DECL_THUNK_P (decl))
- DECL_SOURCE_LOCATION (decl) = input_location;
-
- note_vague_linkage_fn (decl);
- }
+ note_vague_linkage_fn (decl);
/* Is it a synthesized method that needs to be synthesized? */
if (TREE_CODE (decl) == FUNCTION_DECL
@@ -3954,6 +3938,11 @@ mark_used (tree decl)
&& DECL_DEFAULTED_FN (decl)
&& ! DECL_INITIAL (decl))
{
+ /* Remember the current location for a function we will end up
+ synthesizing. Then we can inform the user where it was
+ required in the case of error. */
+ DECL_SOURCE_LOCATION (decl) = input_location;
+
/* Synthesizing an implicitly defined member function will result in
garbage collection. We must treat this situation as if we were
within the body of a function so as to avoid collecting live data
diff --git a/gcc/cp/method.c b/gcc/cp/method.c
index 6950c2d..4563e8f 100644
--- a/gcc/cp/method.c
+++ b/gcc/cp/method.c
@@ -157,8 +157,6 @@ make_thunk (tree function, bool this_adjusting,
/* The THUNK is not a pending inline, even if the FUNCTION is. */
DECL_PENDING_INLINE_P (thunk) = 0;
DECL_DECLARED_INLINE_P (thunk) = 0;
- /* Nor has it been deferred. */
- DECL_DEFERRED_FN (thunk) = 0;
/* Nor is it a template instantiation. */
DECL_USE_TEMPLATE (thunk) = 0;
DECL_TEMPLATE_INFO (thunk) = NULL;
@@ -286,7 +284,6 @@ make_alias_for (tree function, tree newid)
DECL_NO_STATIC_CHAIN (alias) = 1;
DECL_PENDING_INLINE_P (alias) = 0;
DECL_DECLARED_INLINE_P (alias) = 0;
- DECL_DEFERRED_FN (alias) = 0;
DECL_USE_TEMPLATE (alias) = 0;
DECL_TEMPLATE_INSTANTIATED (alias) = 0;
DECL_TEMPLATE_INFO (alias) = NULL;