aboutsummaryrefslogtreecommitdiff
path: root/lib/Parse/Parser.cpp
diff options
context:
space:
mode:
authorMichael Han <fragmentshaders@gmail.com>2013-02-22 17:15:32 +0000
committerMichael Han <fragmentshaders@gmail.com>2013-02-22 17:15:32 +0000
commit684aa73192d92850a926870be62a1787eb5b7ed9 (patch)
tree36381fcea5e163589fe33a8de99c91b817ce336a /lib/Parse/Parser.cpp
parent5dd8f280980451d475a37db087adab991c1b5655 (diff)
[Sema] Semantic analysis for empty-declaration and attribute-declaration.
Introduce a new AST Decl node "EmptyDecl" to model empty-declaration. Have attributes from attribute-declaration appertain to the EmptyDecl node by creating the AST representations of these attributes and attach them to the EmptyDecl node so these attributes can be sema checked just as attributes attached to "normal" declarations. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175900 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Parse/Parser.cpp')
-rw-r--r--lib/Parse/Parser.cpp12
1 files changed, 4 insertions, 8 deletions
diff --git a/lib/Parse/Parser.cpp b/lib/Parse/Parser.cpp
index d9772755bd..24849edd63 100644
--- a/lib/Parse/Parser.cpp
+++ b/lib/Parse/Parser.cpp
@@ -626,15 +626,11 @@ Parser::ParseExternalDeclaration(ParsedAttributesWithRange &attrs,
return DeclGroupPtrTy();
case tok::semi:
// Either a C++11 empty-declaration or attribute-declaration.
- if (attrs.Range.isValid()) {
- // FIXME: Add an AST representation for this.
- Actions.ActOnAttributeDeclaration(attrs.getList());
- return DeclGroupPtrTy();
- }
-
+ SingleDecl = Actions.ActOnEmptyDeclaration(getCurScope(),
+ attrs.getList(),
+ Tok.getLocation());
ConsumeExtraSemi(OutsideFunction);
- // TODO: Invoke action for top-level semicolon.
- return DeclGroupPtrTy();
+ break;
case tok::r_brace:
Diag(Tok, diag::err_extraneous_closing_brace);
ConsumeBrace();