Implement a FIXME, we now pass in the locations of the braces for enums.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71930 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Parse/ParseDecl.cpp b/lib/Parse/ParseDecl.cpp
index cdf84bf..db24d21 100644
--- a/lib/Parse/ParseDecl.cpp
+++ b/lib/Parse/ParseDecl.cpp
@@ -1534,10 +1534,10 @@
}
// Eat the }.
- MatchRHSPunctuation(tok::r_brace, LBraceLoc);
+ SourceLocation RBraceLoc = MatchRHSPunctuation(tok::r_brace, LBraceLoc);
- Actions.ActOnEnumBody(StartLoc, EnumDecl, &EnumConstantDecls[0],
- EnumConstantDecls.size());
+ Actions.ActOnEnumBody(StartLoc, LBraceLoc, RBraceLoc, EnumDecl,
+ &EnumConstantDecls[0], EnumConstantDecls.size());
Action::AttrTy *AttrList = 0;
// If attributes exist after the identifier list, parse them.
diff --git a/lib/Sema/Sema.h b/lib/Sema/Sema.h
index 817924a..9a12dfd 100644
--- a/lib/Sema/Sema.h
+++ b/lib/Sema/Sema.h
@@ -489,7 +489,8 @@
DeclPtrTy LastEnumConstant,
SourceLocation IdLoc, IdentifierInfo *Id,
SourceLocation EqualLoc, ExprTy *Val);
- virtual void ActOnEnumBody(SourceLocation EnumLoc, DeclPtrTy EnumDecl,
+ virtual void ActOnEnumBody(SourceLocation EnumLoc, SourceLocation LBraceLoc,
+ SourceLocation RBraceLoc, DeclPtrTy EnumDecl,
DeclPtrTy *Elements, unsigned NumElements);
DeclContext *getContainingDC(DeclContext *DC);
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp
index 860dda0..1ed063a 100644
--- a/lib/Sema/SemaDecl.cpp
+++ b/lib/Sema/SemaDecl.cpp
@@ -4215,9 +4215,8 @@
return DeclPtrTy::make(New);
}
-// FIXME: For consistency with ActOnFields(), we should have the parser
-// pass in the source location for the left/right braces.
-void Sema::ActOnEnumBody(SourceLocation EnumLoc, DeclPtrTy EnumDeclX,
+void Sema::ActOnEnumBody(SourceLocation EnumLoc, SourceLocation LBraceLoc,
+ SourceLocation RBraceLoc, DeclPtrTy EnumDeclX,
DeclPtrTy *Elements, unsigned NumElements) {
EnumDecl *Enum = cast<EnumDecl>(EnumDeclX.getAs<Decl>());
QualType EnumType = Context.getTypeDeclType(Enum);
diff --git a/lib/Sema/SemaTemplateInstantiateDecl.cpp b/lib/Sema/SemaTemplateInstantiateDecl.cpp
index 382c2fa..fb4d27a 100644
--- a/lib/Sema/SemaTemplateInstantiateDecl.cpp
+++ b/lib/Sema/SemaTemplateInstantiateDecl.cpp
@@ -245,7 +245,9 @@
}
}
- SemaRef.ActOnEnumBody(Enum->getLocation(), Sema::DeclPtrTy::make(Enum),
+ // FIXME: Fixup LBraceLoc and RBraceLoc
+ SemaRef.ActOnEnumBody(Enum->getLocation(), SourceLocation(), SourceLocation(),
+ Sema::DeclPtrTy::make(Enum),
&Enumerators[0], Enumerators.size());
return Enum;