summaryrefslogtreecommitdiff
path: root/gcc/varasm.c
diff options
context:
space:
mode:
authoraustern <austern@138bc75d-0d04-0410-961f-82ee72b054a4>2003-11-06 22:08:26 +0000
committeraustern <austern@138bc75d-0d04-0410-961f-82ee72b054a4>2003-11-06 22:08:26 +0000
commit9c40570af36d485a0b1b2cf8c5d0dc3a047cfaaa (patch)
treec4ffb9b377ba06be592c6688dd70529152203fd4 /gcc/varasm.c
parent5772d010eebef46859ae8e17830217b02548d970 (diff)
downloadgcc-9c40570af36d485a0b1b2cf8c5d0dc3a047cfaaa.tar.gz
* c-common.c (handle_visibility_attribute): Set DECL_VISIBILITY
field instead of hanging an attribute object off the decl. * tree.h (DECL_VISIBLITY): New accessor macro for symbol_visibility field in struct tree_decl. (enum symbol_visibility): Move definition to before tree_decl. (struct tree_decl): Define new two-bit field, symbol_visibility. (decl_visibility): Remove declaration. * varasm.c (maybe_assemble_visibility): Use DECL_VISIBILITY instead of decl_visibility. (default_binds_local_p_1): Use DECL_VISIBILITY instead of decl_visibility. (decl_visibility): Remove. * cp/decl.c (duplicate_decls): copy DECL_VISIBILITY field. * cp/method.c (use_thunk): give thunk same visibility as function. * cp/optimize.c (maybe_clone_body): copy DECL_VISIBILITY field. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@73320 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/varasm.c')
-rw-r--r--gcc/varasm.c28
1 files changed, 2 insertions, 26 deletions
diff --git a/gcc/varasm.c b/gcc/varasm.c
index 21b76b9a59c..9ee145db387 100644
--- a/gcc/varasm.c
+++ b/gcc/varasm.c
@@ -4430,7 +4430,7 @@ default_assemble_visibility (tree decl, int vis)
static void
maybe_assemble_visibility (tree decl)
{
- enum symbol_visibility vis = decl_visibility (decl);
+ enum symbol_visibility vis = DECL_VISIBILITY (decl);
if (vis != VISIBILITY_DEFAULT)
(* targetm.asm_out.visibility) (decl, vis);
@@ -4532,30 +4532,6 @@ decl_tls_model (tree decl)
return kind;
}
-enum symbol_visibility
-decl_visibility (tree decl)
-{
- tree attr = lookup_attribute ("visibility", DECL_ATTRIBUTES (decl));
-
- if (attr)
- {
- const char *which = TREE_STRING_POINTER (TREE_VALUE (TREE_VALUE (attr)));
-
- if (strcmp (which, "default") == 0)
- return VISIBILITY_DEFAULT;
- if (strcmp (which, "internal") == 0)
- return VISIBILITY_INTERNAL;
- if (strcmp (which, "hidden") == 0)
- return VISIBILITY_HIDDEN;
- if (strcmp (which, "protected") == 0)
- return VISIBILITY_PROTECTED;
-
- abort ();
- }
-
- return VISIBILITY_DEFAULT;
-}
-
/* Select a set of attributes for section NAME based on the properties
of DECL and whether or not RELOC indicates that DECL's initializer
might contain runtime relocations.
@@ -5131,7 +5107,7 @@ default_binds_local_p_1 (tree exp, int shlib)
else if (! TREE_PUBLIC (exp))
local_p = true;
/* A variable is local if the user tells us so. */
- else if (decl_visibility (exp) != VISIBILITY_DEFAULT)
+ else if (DECL_VISIBILITY (exp) != VISIBILITY_DEFAULT)
local_p = true;
/* Otherwise, variables defined outside this object may not be local. */
else if (DECL_EXTERNAL (exp))