]> granicus.if.org Git - clang/commitdiff
Pass the right brace SourceLocation from the Parser to the TagDecls.
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>
Tue, 14 Jul 2009 03:17:52 +0000 (03:17 +0000)
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>
Tue, 14 Jul 2009 03:17:52 +0000 (03:17 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75591 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Parse/Action.h
lib/Parse/ParseDecl.cpp
lib/Parse/ParseDeclCXX.cpp
lib/Sema/Sema.h
lib/Sema/SemaDecl.cpp

index 9b8a99c2c1d0ac5475666e1ffcbcced467e15553..cba3dea5c8ee4ba1c40120c1b1ab2907be3e70d8 100644 (file)
@@ -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,
index 1ddd20a9ecbf82253fc1fe100b1b646ed6bc29cf..94855b24f5ffcfe3db645a3580b5e2c37784ce4b 100644 (file)
@@ -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
index 373d22fd9f4fdeef867305141c9109d988dd4abe..88e027db02ebd4ba916c6c068721c0d44ee49c66 100644 (file)
@@ -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,
index c2a484e75a0a1bebff709372dc79598677be8c25..844566081629729b088665817bca332998ac45df 100644 (file)
@@ -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,
index baa2a2b9abb0c951c00f4480166d88ad2b405a69..3ce11570feb04dc4c02ab7d809cb9683d1ac5d2f 100644 (file)
@@ -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();