aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree.h
diff options
context:
space:
mode:
authorMatt Austern <austern@apple.com>2003-11-06 22:08:26 +0000
committerMatt Austern <austern@gcc.gnu.org>2003-11-06 22:08:26 +0000
commit968b41a1662526b8b3eb5861f7fb369450ff9644 (patch)
treec4ffb9b377ba06be592c6688dd70529152203fd4 /gcc/tree.h
parent63e292b7ec0ae980f7ffa763448c81a923a72321 (diff)
downloadgcc-968b41a1662526b8b3eb5861f7fb369450ff9644.zip
gcc-968b41a1662526b8b3eb5861f7fb369450ff9644.tar.gz
gcc-968b41a1662526b8b3eb5861f7fb369450ff9644.tar.bz2
c-common.c (handle_visibility_attribute): Set DECL_VISIBILITY field instead of hanging an attribute object off the decl.
* 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. From-SVN: r73320
Diffstat (limited to 'gcc/tree.h')
-rw-r--r--gcc/tree.h28
1 files changed, 16 insertions, 12 deletions
diff --git a/gcc/tree.h b/gcc/tree.h
index e621741..03b85df 100644
--- a/gcc/tree.h
+++ b/gcc/tree.h
@@ -1491,6 +1491,9 @@ struct tree_type GTY(())
#define DECL_DECLARED_INLINE_P(NODE) \
(FUNCTION_DECL_CHECK (NODE)->decl.declared_inline_flag)
+/* Value of the decls's visibility attribute */
+#define DECL_VISIBILITY(NODE) (DECL_CHECK (NODE)->decl.visibility)
+
/* In a FUNCTION_DECL, nonzero if the function cannot be inlined. */
#define DECL_UNINLINABLE(NODE) (FUNCTION_DECL_CHECK (NODE)->decl.uninlinable)
@@ -1631,6 +1634,16 @@ struct tree_type GTY(())
(! DECL_CONTEXT (EXP) \
|| TREE_CODE (DECL_CONTEXT (EXP)) == TRANSLATION_UNIT_DECL)
+/* Enumerate visibility settings. */
+
+enum symbol_visibility
+{
+ VISIBILITY_DEFAULT,
+ VISIBILITY_INTERNAL,
+ VISIBILITY_HIDDEN,
+ VISIBILITY_PROTECTED
+};
+
struct function;
struct tree_decl GTY(())
@@ -1672,8 +1685,9 @@ struct tree_decl GTY(())
unsigned uninlinable : 1;
unsigned thread_local_flag : 1;
unsigned declared_inline_flag : 1;
- unsigned unused : 3;
- /* three unused bits. */
+ ENUM_BITFIELD(symbol_visibility) visibility : 2;
+ unsigned unused : 1;
+ /* one unused bit. */
unsigned lang_flag_0 : 1;
unsigned lang_flag_1 : 1;
@@ -2007,15 +2021,6 @@ enum tls_model {
extern enum tls_model flag_tls_default;
-/* Enumerate visibility settings. */
-
-enum symbol_visibility
-{
- VISIBILITY_DEFAULT,
- VISIBILITY_INTERNAL,
- VISIBILITY_HIDDEN,
- VISIBILITY_PROTECTED
-};
/* A pointer-to-function member type looks like:
@@ -2969,7 +2974,6 @@ extern void make_decl_one_only (tree);
extern int supports_one_only (void);
extern void variable_section (tree, int);
enum tls_model decl_tls_model (tree);
-enum symbol_visibility decl_visibility (tree);
extern void resolve_unique_section (tree, int, int);
extern void mark_referenced (tree);
extern void notice_global_symbol (tree);