aboutsummaryrefslogtreecommitdiff
path: root/gcc/cgraph.h
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/cgraph.h')
-rw-r--r--gcc/cgraph.h51
1 files changed, 24 insertions, 27 deletions
diff --git a/gcc/cgraph.h b/gcc/cgraph.h
index dc286d9..1a5e85e 100644
--- a/gcc/cgraph.h
+++ b/gcc/cgraph.h
@@ -37,6 +37,19 @@ enum symtab_type
SYMTAB_VARIABLE
};
+/* Section names are stored as reference counted strings in GGC safe hashtable
+ (to make them survive through PCH). */
+
+struct GTY(()) section_hash_entry_d
+{
+ int ref_count;
+ char *name; /* As long as this datastructure stays in GGC, we can not put
+ string at the tail of structure of GGC dies in horrible
+ way */
+};
+
+typedef struct section_hash_entry_d section_hash_entry;
+
/* Base of all entries in the symbol table.
The symtab_node is inherited by cgraph and varpol nodes. */
class GTY((desc ("%h.type"), tag ("SYMTAB_SYMBOL"),
@@ -147,14 +160,14 @@ public:
/* Return comdat group. */
tree get_comdat_group ()
{
- return comdat_group_;
+ return x_comdat_group;
}
tree get_comdat_group_id ()
{
- if (comdat_group_ && TREE_CODE (comdat_group_) != IDENTIFIER_NODE)
- comdat_group_ = DECL_ASSEMBLER_NAME (comdat_group_);
- return comdat_group_;
+ if (x_comdat_group && TREE_CODE (x_comdat_group) != IDENTIFIER_NODE)
+ x_comdat_group = DECL_ASSEMBLER_NAME (x_comdat_group);
+ return x_comdat_group;
}
/* Set comdat group. */
@@ -162,32 +175,15 @@ public:
{
gcc_checking_assert (!group || TREE_CODE (group) == IDENTIFIER_NODE
|| DECL_P (group));
- comdat_group_ = group;
- }
-
- /* Return section as STRING_CST. */
- tree get_section_name ()
- {
- return section_;
+ x_comdat_group = group;
}
/* Return section as string. */
const char * get_section ()
{
- if (!section_)
+ if (!x_section)
return NULL;
- return TREE_STRING_POINTER (section_);
- }
-
- /* Set section, do not recurse into aliases.
- When one wants to change section of symbol and its aliases,
- use set_section */
- void set_section_for_node (tree section)
- {
- gcc_checking_assert (!section || TREE_CODE (section) == STRING_CST);
- section_ = section;
- if (!section)
- implicit_section = false;
+ return x_section->name;
}
/* Vectors of referring and referenced entities. */
@@ -204,13 +200,14 @@ public:
PTR GTY ((skip)) aux;
/* Comdat group the symbol is in. Can be private if GGC allowed that. */
- tree comdat_group_;
+ tree x_comdat_group;
/* Section name. Again can be private, if allowed. */
- tree section_;
+ section_hash_entry *x_section;
/* Set section for symbol and its aliases. */
- void set_section (tree section);
+ void set_section (const char *section);
+ void set_section_for_node (const char *section);
};
enum availability