Annotate EnumSpecifierASTs with the Enum symbols.

This commit is contained in:
Roberto Raggi
2010-08-09 17:17:50 +02:00
parent 633580d7f3
commit 646baadb59
2 changed files with 5 additions and 0 deletions

View File

@@ -1623,6 +1623,9 @@ public:
EnumeratorListAST *enumerator_list;
unsigned rbrace_token;
public: // annotations
Enum *symbol;
public:
EnumSpecifierAST()
: enum_token(0)
@@ -1630,6 +1633,7 @@ public:
, lbrace_token(0)
, enumerator_list(0)
, rbrace_token(0)
, symbol(0)
{}
virtual EnumSpecifierAST *asEnumSpecifier() { return this; }

View File

@@ -407,6 +407,7 @@ bool CheckSpecifier::visit(EnumSpecifierAST *ast)
const Name *name = semantic()->check(ast->name, _scope);
Enum *e = control()->newEnum(sourceLocation, name);
ast->symbol = e;
e->members()->setStartOffset(scopeStart);
e->members()->setEndOffset(tokenAt(ast->lastToken() - 1).end());
e->setVisibility(semantic()->currentVisibility());