aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2009-07-14 03:17:52 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2009-07-14 03:17:52 +0000
commit07a5b282fbe719986df9ed05543081ea0ed94aa5 (patch)
tree514815c315f2ea7b24e564bb2e1cefb71dbe8dff
parentf602c8b6ce1a269c0bf8b3f049e923f4ea5c18e2 (diff)
Pass the right brace SourceLocation from the Parser to the TagDecls.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75591 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/clang/Parse/Action.h3
-rw-r--r--lib/Parse/ParseDecl.cpp4
-rw-r--r--lib/Parse/ParseDeclCXX.cpp2
-rw-r--r--lib/Sema/Sema.h3
-rw-r--r--lib/Sema/SemaDecl.cpp4
5 files changed, 10 insertions, 6 deletions
diff --git a/include/clang/Parse/Action.h b/include/clang/Parse/Action.h
index 9b8a99c2c1..cba3dea5c8 100644
--- a/include/clang/Parse/Action.h
+++ b/include/clang/Parse/Action.h
@@ -455,7 +455,8 @@ public:
/// ActOnTagFinishDefinition - Invoked once we have finished parsing
/// the definition of a tag (enumeration, class, struct, or union).
- virtual void ActOnTagFinishDefinition(Scope *S, DeclPtrTy TagDecl) { }
+ virtual void ActOnTagFinishDefinition(Scope *S, DeclPtrTy TagDecl,
+ SourceLocation RBraceLoc) { }
virtual DeclPtrTy ActOnEnumConstant(Scope *S, DeclPtrTy EnumDecl,
DeclPtrTy LastEnumConstant,
diff --git a/lib/Parse/ParseDecl.cpp b/lib/Parse/ParseDecl.cpp
index 1ddd20a9ec..94855b24f5 100644
--- a/lib/Parse/ParseDecl.cpp
+++ b/lib/Parse/ParseDecl.cpp
@@ -1500,7 +1500,7 @@ void Parser::ParseStructUnionBody(SourceLocation RecordLoc,
LBraceLoc, RBraceLoc,
AttrList);
StructScope.Exit();
- Actions.ActOnTagFinishDefinition(CurScope, TagDecl);
+ Actions.ActOnTagFinishDefinition(CurScope, TagDecl, RBraceLoc);
}
@@ -1656,7 +1656,7 @@ void Parser::ParseEnumBody(SourceLocation StartLoc, DeclPtrTy EnumDecl) {
AttrList = ParseAttributes(); // FIXME: where do they do?
EnumScope.Exit();
- Actions.ActOnTagFinishDefinition(CurScope, EnumDecl);
+ Actions.ActOnTagFinishDefinition(CurScope, EnumDecl, RBraceLoc);
}
/// isTypeSpecifierQualifier - Return true if the current token could be the
diff --git a/lib/Parse/ParseDeclCXX.cpp b/lib/Parse/ParseDeclCXX.cpp
index 373d22fd9f..88e027db02 100644
--- a/lib/Parse/ParseDeclCXX.cpp
+++ b/lib/Parse/ParseDeclCXX.cpp
@@ -1213,7 +1213,7 @@ void Parser::ParseCXXMemberSpecification(SourceLocation RecordLoc,
ParsingDef.Pop();
ClassScope.Exit();
- Actions.ActOnTagFinishDefinition(CurScope, TagDecl);
+ Actions.ActOnTagFinishDefinition(CurScope, TagDecl, RBraceLoc);
}
/// ParseConstructorInitializer - Parse a C++ constructor initializer,
diff --git a/lib/Sema/Sema.h b/lib/Sema/Sema.h
index c2a484e75a..8445660816 100644
--- a/lib/Sema/Sema.h
+++ b/lib/Sema/Sema.h
@@ -563,7 +563,8 @@ public:
/// ActOnTagFinishDefinition - Invoked once we have finished parsing
/// the definition of a tag (enumeration, class, struct, or union).
- virtual void ActOnTagFinishDefinition(Scope *S, DeclPtrTy TagDecl);
+ virtual void ActOnTagFinishDefinition(Scope *S, DeclPtrTy TagDecl,
+ SourceLocation RBraceLoc);
EnumConstantDecl *CheckEnumConstant(EnumDecl *Enum,
EnumConstantDecl *LastEnumConst,
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp
index baa2a2b9ab..3ce11570fe 100644
--- a/lib/Sema/SemaDecl.cpp
+++ b/lib/Sema/SemaDecl.cpp
@@ -3830,9 +3830,11 @@ void Sema::ActOnTagStartDefinition(Scope *S, DeclPtrTy TagD) {
}
}
-void Sema::ActOnTagFinishDefinition(Scope *S, DeclPtrTy TagD) {
+void Sema::ActOnTagFinishDefinition(Scope *S, DeclPtrTy TagD,
+ SourceLocation RBraceLoc) {
AdjustDeclIfTemplate(TagD);
TagDecl *Tag = cast<TagDecl>(TagD.getAs<Decl>());
+ Tag->setRBraceLoc(RBraceLoc);
if (isa<CXXRecordDecl>(Tag))
FieldCollector->FinishClass();