summaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorgeoffk <geoffk@138bc75d-0d04-0410-961f-82ee72b054a4>2004-08-05 05:52:01 +0000
committergeoffk <geoffk@138bc75d-0d04-0410-961f-82ee72b054a4>2004-08-05 05:52:01 +0000
commitb2c4af5e79a1c17df9214775988a66dac92f2667 (patch)
treedd22110790902e6a0fb0065c11210552323ea19e /gcc/cp
parentdffd35e9cbc1fc31997e74bcbccfab6a0d5327a6 (diff)
downloadgcc-b2c4af5e79a1c17df9214775988a66dac92f2667.tar.gz
2004-08-04 Geoffrey Keating <geoffk@apple.com>
PR 14516 * c-common.c (c_expand_decl): Don't special-case static VAR_DECLs. * c-common.h (make_rtl_for_local_static): Delete. * c-decl.c (shadow_tag_warned): Clean up comment. (finish_decl): Clean up spacing. Use set_user_assembler_name when appropriate. Don't pass asmspec to rest_of_decl_compilation. * c-semantics.c (make_rtl_for_local_static): Delete. * expr.c (init_block_move_fn): Use set_user_assembler_name. (init_block_clear_fn): Likewise. * passes.c (rest_of_decl_compilation): Remove asmspec parameter, expect it to be in DECL_ASSEMBLER_NAME. Update callers in many files. * toplev.h (rest_of_decl_compilation): Remove asmspec parameter. * tree.h (make_decl_rtl): Remove second parameter. (set_user_assembler_name): New. * varasm.c (set_user_assembler_name): New. (make_decl_rtl): Remove second parameter. Update callers in many files. Index: cp/ChangeLog 2004-08-04 Geoffrey Keating <geoffk@apple.com> * decl.c (make_rtl_for_nonlocal_decl): Set DECL_ASSEMBLER_NAME rather than passing it as a parameter to rest_of_decl_compilation. * decl2.c (grokfield): Use set_user_assembler_name. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@85593 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog6
-rw-r--r--gcc/cp/call.c2
-rw-r--r--gcc/cp/class.c2
-rw-r--r--gcc/cp/decl.c45
-rw-r--r--gcc/cp/decl2.c13
-rw-r--r--gcc/cp/init.c2
-rw-r--r--gcc/cp/method.c3
7 files changed, 35 insertions, 38 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 20577618fe4..9f17d437a66 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,9 @@
+2004-08-04 Geoffrey Keating <geoffk@apple.com>
+
+ * decl.c (make_rtl_for_nonlocal_decl): Set DECL_ASSEMBLER_NAME rather
+ than passing it as a parameter to rest_of_decl_compilation.
+ * decl2.c (grokfield): Use set_user_assembler_name.
+
2004-08-04 Nathan Sidwell <nathan@codesourcery.com>
* decl.c (complete_array_type): Don't gratuitously copy
diff --git a/gcc/cp/call.c b/gcc/cp/call.c
index a34eb271001..194b3396db9 100644
--- a/gcc/cp/call.c
+++ b/gcc/cp/call.c
@@ -6516,7 +6516,7 @@ initialize_reference (tree type, tree expr, tree decl, tree *cleanup)
}
else
{
- rest_of_decl_compilation (var, NULL, /*toplev=*/1, at_eof);
+ rest_of_decl_compilation (var, /*toplev=*/1, at_eof);
if (TYPE_HAS_NONTRIVIAL_DESTRUCTOR (type))
static_aggregates = tree_cons (NULL_TREE, var,
static_aggregates);
diff --git a/gcc/cp/class.c b/gcc/cp/class.c
index e0bae52179f..665fd7abd16 100644
--- a/gcc/cp/class.c
+++ b/gcc/cp/class.c
@@ -3832,7 +3832,7 @@ build_clone (tree fn, tree name)
/* Create the RTL for this function. */
SET_DECL_RTL (clone, NULL_RTX);
- rest_of_decl_compilation (clone, NULL, /*top_level=*/1, at_eof);
+ rest_of_decl_compilation (clone, /*top_level=*/1, at_eof);
/* Make it easy to find the CLONE given the FN. */
TREE_CHAIN (clone) = TREE_CHAIN (fn);
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index 10e0766b3d7..96534362226 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -1954,7 +1954,7 @@ duplicate_decls (tree newdecl, tree olddecl)
&& (TREE_CODE (olddecl) == FUNCTION_DECL
|| (TREE_CODE (olddecl) == VAR_DECL
&& TREE_STATIC (olddecl))))
- make_decl_rtl (olddecl, NULL);
+ make_decl_rtl (olddecl);
return olddecl;
}
@@ -4512,10 +4512,25 @@ make_rtl_for_nonlocal_decl (tree decl, tree init, const char* asmspec)
int toplev = toplevel_bindings_p ();
int defer_p;
+ /* Set the DECL_ASSEMBLER_NAME for the object. */
+ if (asmspec)
+ {
+ /* The `register' keyword, when used together with an
+ asm-specification, indicates that the variable should be
+ placed in a particular register. */
+ if (TREE_CODE (decl) == VAR_DECL && DECL_REGISTER (decl))
+ {
+ change_decl_assembler_name (decl, get_identifier (asmspec));
+ DECL_HARD_REGISTER (decl) = 1;
+ }
+ else
+ set_user_assembler_name (decl, asmspec);
+ }
+
/* Handle non-variables up front. */
if (TREE_CODE (decl) != VAR_DECL)
{
- rest_of_decl_compilation (decl, asmspec, toplev, at_eof);
+ rest_of_decl_compilation (decl, toplev, at_eof);
return;
}
@@ -4530,17 +4545,6 @@ make_rtl_for_nonlocal_decl (tree decl, tree init, const char* asmspec)
my_friendly_assert (DECL_EXTERNAL (decl), 20000723);
}
- /* Set the DECL_ASSEMBLER_NAME for the variable. */
- if (asmspec)
- {
- change_decl_assembler_name (decl, get_identifier (asmspec));
- /* The `register' keyword, when used together with an
- asm-specification, indicates that the variable should be
- placed in a particular register. */
- if (DECL_REGISTER (decl))
- DECL_HARD_REGISTER (decl) = 1;
- }
-
/* We don't create any RTL for local variables. */
if (DECL_FUNCTION_SCOPE_P (decl) && !TREE_STATIC (decl))
return;
@@ -4574,16 +4578,9 @@ make_rtl_for_nonlocal_decl (tree decl, tree init, const char* asmspec)
&& DECL_IMPLICIT_INSTANTIATION (decl))
defer_p = 1;
- /* If we're deferring the variable, we only need to make RTL if
- there's an ASMSPEC. Otherwise, we'll lazily create it later when
- we need it. (There's no way to lazily create RTL for things that
- have assembly specs because the information about the specifier
- isn't stored in the tree, yet) */
- if (defer_p && asmspec)
- make_decl_rtl (decl, asmspec);
/* If we're not deferring, go ahead and assemble the variable. */
- else if (!defer_p)
- rest_of_decl_compilation (decl, asmspec, toplev, at_eof);
+ if (!defer_p)
+ rest_of_decl_compilation (decl, toplev, at_eof);
}
/* Generate code to initialize DECL (a local variable). */
@@ -4744,8 +4741,8 @@ cp_finish_decl (tree decl, tree init, tree asmspec_tree, int flags)
&& !COMPLETE_TYPE_P (TREE_TYPE (decl)))
TYPE_DECL_SUPPRESS_DEBUG (decl) = 1;
- rest_of_decl_compilation (decl, NULL,
- DECL_CONTEXT (decl) == NULL_TREE, at_eof);
+ rest_of_decl_compilation (decl, DECL_CONTEXT (decl) == NULL_TREE,
+ at_eof);
goto finish_end;
}
diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c
index 53060dd16fa..90f1cd176c5 100644
--- a/gcc/cp/decl2.c
+++ b/gcc/cp/decl2.c
@@ -975,12 +975,7 @@ grokfield (const cp_declarator *declarator,
if (TREE_CODE (value) == FUNCTION_DECL)
{
if (asmspec)
- {
- /* This must override the asm specifier which was placed
- by grokclassfn. Lay this out fresh. */
- SET_DECL_RTL (value, NULL_RTX);
- change_decl_assembler_name (value, get_identifier (asmspec));
- }
+ set_user_assembler_name (value, asmspec);
if (!DECL_FRIEND_P (value))
grok_special_member_properties (value);
@@ -1229,7 +1224,7 @@ finish_anon_union (tree anon_union_decl)
&& at_function_scope_p ())
add_decl_expr (anon_union_decl);
else if (!processing_template_decl)
- rest_of_decl_compilation (anon_union_decl, NULL,
+ rest_of_decl_compilation (anon_union_decl,
toplevel_bindings_p (), at_eof);
}
@@ -1601,7 +1596,7 @@ maybe_emit_vtables (tree ctype)
/* Write it out. */
DECL_EXTERNAL (vtbl) = 0;
- rest_of_decl_compilation (vtbl, NULL, 1, 1);
+ rest_of_decl_compilation (vtbl, 1, 1);
/* Because we're only doing syntax-checking, we'll never end up
actually marking the variable as written. */
@@ -2548,7 +2543,7 @@ write_out_vars (tree vars)
if (!var_finalized_p (var))
{
import_export_decl (var);
- rest_of_decl_compilation (var, 0, 1, 1);
+ rest_of_decl_compilation (var, 1, 1);
}
}
}
diff --git a/gcc/cp/init.c b/gcc/cp/init.c
index 776b99670d7..b84994c615b 100644
--- a/gcc/cp/init.c
+++ b/gcc/cp/init.c
@@ -1728,7 +1728,7 @@ build_java_class_ref (tree type)
DECL_ARTIFICIAL (class_decl) = 1;
DECL_IGNORED_P (class_decl) = 1;
pushdecl_top_level (class_decl);
- make_decl_rtl (class_decl, NULL);
+ make_decl_rtl (class_decl);
}
return class_decl;
}
diff --git a/gcc/cp/method.c b/gcc/cp/method.c
index 317790e877f..eb4b64aa8ee 100644
--- a/gcc/cp/method.c
+++ b/gcc/cp/method.c
@@ -1024,8 +1024,7 @@ implicitly_declare_fn (special_function_kind kind, tree type, bool const_p)
TYPE_UNQUALIFIED);
grok_special_member_properties (fn);
set_linkage_according_to_type (type, fn);
- rest_of_decl_compilation (fn, /*asmspec=*/NULL,
- toplevel_bindings_p (), at_eof);
+ rest_of_decl_compilation (fn, toplevel_bindings_p (), at_eof);
DECL_IN_AGGR_P (fn) = 1;
DECL_ARTIFICIAL (fn) = 1;
DECL_NOT_REALLY_EXTERN (fn) = 1;