aboutsummaryrefslogtreecommitdiff
path: root/gcc/varasm.c
diff options
context:
space:
mode:
authorRichard Henderson <rth@redhat.com>2002-03-02 20:50:53 -0800
committerRichard Henderson <rth@gcc.gnu.org>2002-03-02 20:50:53 -0800
commitb14707c32c79de908de45735e2c5f17e89776563 (patch)
treebbda082e91221cd2570817b8af1eb6de817d8392 /gcc/varasm.c
parentb20032503b0ecc63b4ce05e65fda684b47afef3b (diff)
downloadgcc-b14707c32c79de908de45735e2c5f17e89776563.zip
gcc-b14707c32c79de908de45735e2c5f17e89776563.tar.gz
gcc-b14707c32c79de908de45735e2c5f17e89776563.tar.bz2
attribs.c (handle_alias_attribute): Don't call assemble_alias.
* attribs.c (handle_alias_attribute): Don't call assemble_alias. (handle_visibility_attribute): Don't call assemble_visibility. * toplev.c (rest_of_decl_compilation): Invoke make_decl_rtl even without asmspec. Invoke assemble_alias when needed. * varasm.c (maybe_assemble_visibility): New. (assemble_start_function, assemble_variable, assemble_alias): Use it. From-SVN: r50237
Diffstat (limited to 'gcc/varasm.c')
-rw-r--r--gcc/varasm.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/gcc/varasm.c b/gcc/varasm.c
index 4d57b89..187429e 100644
--- a/gcc/varasm.c
+++ b/gcc/varasm.c
@@ -171,6 +171,7 @@ static void mark_weak_decls PARAMS ((void *));
#if defined (ASM_WEAKEN_LABEL) || defined (ASM_WEAKEN_DECL)
static void remove_from_pending_weak_list PARAMS ((const char *));
#endif
+static void maybe_assemble_visibility PARAMS ((tree));
static int in_named_entry_eq PARAMS ((const PTR, const PTR));
static hashval_t in_named_entry_hash PARAMS ((const PTR));
#ifdef ASM_OUTPUT_BSS
@@ -1252,6 +1253,8 @@ assemble_start_function (decl, fnname)
else
#endif
ASM_GLOBALIZE_LABEL (asm_out_file, fnname);
+
+ maybe_assemble_visibility (decl);
}
/* Do any machine/system dependent processing of the function name */
@@ -1603,6 +1606,9 @@ assemble_variable (decl, top_level, at_end, dont_output_data)
DECL_ALIGN (decl) = align;
set_mem_align (decl_rtl, align);
+ if (TREE_PUBLIC (decl))
+ maybe_assemble_visibility (decl);
+
/* Handle uninitialized definitions. */
if ((DECL_INITIAL (decl) == 0 || DECL_INITIAL (decl) == error_mark_node
@@ -5181,6 +5187,8 @@ assemble_alias (decl, target)
else
#endif
ASM_GLOBALIZE_LABEL (asm_out_file, name);
+
+ maybe_assemble_visibility (decl);
}
#ifdef ASM_OUTPUT_DEF_FROM_DECLS
@@ -5225,6 +5233,21 @@ assemble_visibility (decl, visibility_type)
#endif
}
+/* A helper function to call assemble_visibility when needed for a decl. */
+
+static void
+maybe_assemble_visibility (decl)
+ tree decl;
+{
+ tree visibility = lookup_attribute ("visibility", DECL_ATTRIBUTES (decl));
+ if (visibility)
+ {
+ const char *type
+ = TREE_STRING_POINTER (TREE_VALUE (TREE_VALUE (visibility)));
+ assemble_visibility (decl, type);
+ }
+}
+
/* Returns 1 if the target configuration supports defining public symbols
so that one of them will be chosen at link time instead of generating a
multiply-defined symbol error, whether through the use of weak symbols or