move sym_anonymous to symbol.h
authorMatthias Braun <matze@braunis.de>
Sat, 19 May 2012 14:28:29 +0000 (16:28 +0200)
committerChristoph Mallon <christoph.mallon@gmx.de>
Wed, 20 Jun 2012 19:52:09 +0000 (21:52 +0200)
parser.c
symbol.h
symbol_table.c

index b33c140..8639a7a 100644 (file)
--- a/parser.c
+++ b/parser.c
@@ -139,9 +139,6 @@ static elf_visibility_tag_t default_visibility = ELF_VISIBILITY_DEFAULT;
 #define POP_EXTENSION() \
        ((void)(in_gcc_extension = old_gcc_extension))
 
-/** special symbol used for anonymous entities. */
-static symbol_t *sym_anonymous = NULL;
-
 /** The token anchor set */
 static unsigned short token_anchor_set[T_LAST_TOKEN];
 
@@ -10332,8 +10329,6 @@ void parse(void)
  */
 void init_parser(void)
 {
-       sym_anonymous = symbol_table_insert("<anonymous>");
-
        memset(token_anchor_set, 0, sizeof(token_anchor_set));
 
        init_expression_parsers();
index 2f0dc3b..42ef131 100644 (file)
--- a/symbol.h
+++ b/symbol.h
@@ -23,4 +23,7 @@
 typedef struct symbol_t         symbol_t;
 typedef struct pp_definition_t  pp_definition_t;
 
+/** special symbol used for anonymous/error entities. */
+extern symbol_t *sym_anonymous;
+
 #endif
index 948b154..f43b220 100644 (file)
@@ -68,6 +68,8 @@ void init_symbol_table_entry(symbol_t *entry, const char *string)
 
 static symbol_table_t  symbol_table;
 
+symbol_t *sym_anonymous;
+
 symbol_t *symbol_table_insert(const char *string)
 {
        return _symbol_table_insert(&symbol_table, string);
@@ -77,6 +79,7 @@ void init_symbol_table(void)
 {
        obstack_init(&symbol_obstack);
        _symbol_table_init(&symbol_table);
+       sym_anonymous = symbol_table_insert("<anonymous>");
 }
 
 void exit_symbol_table(void)