summaryrefslogtreecommitdiff
path: root/gcc/cp/decl2.c
diff options
context:
space:
mode:
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>2009-08-24 21:32:12 +0000
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>2009-08-24 21:32:12 +0000
commitb2e9b7542b3ae4526a459d646c7b76a6756f0abf (patch)
tree9fa4c73b40f5bfc98d2cc432e4d582f03e88d5c9 /gcc/cp/decl2.c
parent411978d2740734b2c200d92136dc1a62a05b1b23 (diff)
downloadgcc-b2e9b7542b3ae4526a459d646c7b76a6756f0abf.tar.gz
* decl2.c (mark_used): Streamline logic.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@151062 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp/decl2.c')
-rw-r--r--gcc/cp/decl2.c35
1 files changed, 15 insertions, 20 deletions
diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c
index 960ccf019ab..2ef7a5c6a57 100644
--- a/gcc/cp/decl2.c
+++ b/gcc/cp/decl2.c
@@ -3865,7 +3865,8 @@ mark_used (tree decl)
DECL_LANG_SPECIFIC set, and these are also the only decls that we
might need special handling for. */
if ((TREE_CODE (decl) != VAR_DECL && TREE_CODE (decl) != FUNCTION_DECL)
- || DECL_LANG_SPECIFIC (decl) == NULL)
+ || DECL_LANG_SPECIFIC (decl) == NULL
+ || DECL_THUNK_P (decl))
return;
/* We only want to do this processing once. We don't need to keep trying
@@ -3917,22 +3918,17 @@ mark_used (tree decl)
o the variable or function is not used (3.2 [basic.def.odr]) or is
defined in the same translation unit. */
if (TREE_PUBLIC (decl)
- && (TREE_CODE (decl) == FUNCTION_DECL
- || TREE_CODE (decl) == VAR_DECL)
- && DECL_LANG_SPECIFIC (decl))
- {
- if (!DECL_EXTERN_C_P (decl)
- && !DECL_ARTIFICIAL (decl)
- && !decl_defined_p (decl)
- && no_linkage_check (TREE_TYPE (decl), /*relaxed_p=*/false))
- {
- if (is_local_extern (decl))
- /* There's no way to define a local extern, and adding it to
- the vector interferes with GC, so give an error now. */
- no_linkage_error (decl);
- else
- VEC_safe_push (tree, gc, no_linkage_decls, decl);
- }
+ && !DECL_EXTERN_C_P (decl)
+ && !DECL_ARTIFICIAL (decl)
+ && !decl_defined_p (decl)
+ && no_linkage_check (TREE_TYPE (decl), /*relaxed_p=*/false))
+ {
+ if (is_local_extern (decl))
+ /* There's no way to define a local extern, and adding it to
+ the vector interferes with GC, so give an error now. */
+ no_linkage_error (decl);
+ else
+ VEC_safe_push (tree, gc, no_linkage_decls, decl);
}
if (TREE_CODE (decl) == FUNCTION_DECL && DECL_DECLARED_INLINE_P (decl)
@@ -3956,7 +3952,6 @@ mark_used (tree decl)
if (TREE_CODE (decl) == FUNCTION_DECL
&& DECL_NONSTATIC_MEMBER_FUNCTION_P (decl)
&& DECL_DEFAULTED_FN (decl)
- && !DECL_THUNK_P (decl)
&& ! DECL_INITIAL (decl))
{
/* Synthesizing an implicitly defined member function will result in
@@ -3973,8 +3968,8 @@ mark_used (tree decl)
/* If this is a synthesized method we don't need to
do the instantiation test below. */
}
- else if ((DECL_NON_THUNK_FUNCTION_P (decl) || TREE_CODE (decl) == VAR_DECL)
- && DECL_LANG_SPECIFIC (decl) && DECL_TEMPLATE_INFO (decl)
+ else if ((TREE_CODE (decl) == FUNCTION_DECL || TREE_CODE (decl) == VAR_DECL)
+ && DECL_TEMPLATE_INFO (decl)
&& (!DECL_EXPLICIT_INSTANTIATION (decl)
|| always_instantiate_p (decl)))
/* If this is a function or variable that is an instance of some