Pass postfix attributes to ActOnFields.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56992 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/Driver/PrintParserCallbacks.cpp b/Driver/PrintParserCallbacks.cpp
index caae11b..b616268 100644
--- a/Driver/PrintParserCallbacks.cpp
+++ b/Driver/PrintParserCallbacks.cpp
@@ -205,7 +205,8 @@
virtual void ActOnFields(Scope* S, SourceLocation RecLoc, DeclTy *TagDecl,
DeclTy **Fields, unsigned NumFields,
- SourceLocation LBrac, SourceLocation RBrac) {
+ SourceLocation LBrac, SourceLocation RBrac,
+ AttributeList *AttrList) {
llvm::cout << __FUNCTION__ << "\n";
}
diff --git a/lib/AST/ASTContext.cpp b/lib/AST/ASTContext.cpp
index feb1bad..b373f3a 100644
--- a/lib/AST/ASTContext.cpp
+++ b/lib/AST/ASTContext.cpp
@@ -492,6 +492,8 @@
/// specified record (struct/union/class), which indicates its size and field
/// position information.
const ASTRecordLayout &ASTContext::getASTRecordLayout(const RecordDecl *D) {
+ fprintf(stderr, "%p\n", D->getAttr<PackedAttr>());
+
D = D->getDefinition(*this);
assert(D && "Cannot get layout of forward declarations!");
diff --git a/lib/Parse/ParseDecl.cpp b/lib/Parse/ParseDecl.cpp
index 80970a2..5ea9d13 100644
--- a/lib/Parse/ParseDecl.cpp
+++ b/lib/Parse/ParseDecl.cpp
@@ -764,14 +764,15 @@
SourceLocation RBraceLoc = MatchRHSPunctuation(tok::r_brace, LBraceLoc);
- Actions.ActOnFields(CurScope,
- RecordLoc,TagDecl,&FieldDecls[0],FieldDecls.size(),
- LBraceLoc, RBraceLoc);
-
AttributeList *AttrList = 0;
// If attributes exist after struct contents, parse them.
if (Tok.is(tok::kw___attribute))
AttrList = ParseAttributes(); // FIXME: where should I put them?
+
+ Actions.ActOnFields(CurScope,
+ RecordLoc,TagDecl,&FieldDecls[0],FieldDecls.size(),
+ LBraceLoc, RBraceLoc,
+ AttrList);
}
diff --git a/lib/Parse/ParseObjc.cpp b/lib/Parse/ParseObjc.cpp
index c48cc8a..0222b04 100644
--- a/lib/Parse/ParseObjc.cpp
+++ b/lib/Parse/ParseObjc.cpp
@@ -900,7 +900,7 @@
// for code rewriting tools that need to be aware of the empty list.
Actions.ActOnFields(CurScope, atLoc, interfaceDecl,
&AllIvarDecls[0], AllIvarDecls.size(),
- LBraceLoc, RBraceLoc);
+ LBraceLoc, RBraceLoc, 0);
return;
}
diff --git a/lib/Sema/Sema.h b/lib/Sema/Sema.h
index 696a6f4..36f5de8 100644
--- a/lib/Sema/Sema.h
+++ b/lib/Sema/Sema.h
@@ -282,7 +282,8 @@
virtual void ActOnFields(Scope* S,
SourceLocation RecLoc, DeclTy *TagDecl,
DeclTy **Fields, unsigned NumFields,
- SourceLocation LBrac, SourceLocation RBrac);
+ SourceLocation LBrac, SourceLocation RBrac,
+ AttributeList *AttrList);
virtual DeclTy *ActOnEnumConstant(Scope *S, DeclTy *EnumDecl,
DeclTy *LastEnumConstant,
SourceLocation IdLoc, IdentifierInfo *Id,
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp
index 1d755ef..315bf98 100644
--- a/lib/Sema/SemaDecl.cpp
+++ b/lib/Sema/SemaDecl.cpp
@@ -2111,7 +2111,8 @@
void Sema::ActOnFields(Scope* S,
SourceLocation RecLoc, DeclTy *RecDecl,
DeclTy **Fields, unsigned NumFields,
- SourceLocation LBrac, SourceLocation RBrac) {
+ SourceLocation LBrac, SourceLocation RBrac,
+ AttributeList *Attrs) {
Decl *EnclosingDecl = static_cast<Decl*>(RecDecl);
assert(EnclosingDecl && "missing record or interface decl");
RecordDecl *Record = dyn_cast<RecordDecl>(EnclosingDecl);
diff --git a/lib/Sema/SemaDeclCXX.cpp b/lib/Sema/SemaDeclCXX.cpp
index 85097ca..c469545 100644
--- a/lib/Sema/SemaDeclCXX.cpp
+++ b/lib/Sema/SemaDeclCXX.cpp
@@ -461,7 +461,7 @@
SourceLocation RBrac) {
ActOnFields(S, RLoc, TagDecl,
(DeclTy**)FieldCollector->getCurFields(),
- FieldCollector->getCurNumFields(), LBrac, RBrac);
+ FieldCollector->getCurNumFields(), LBrac, RBrac, 0);
}
void Sema::ActOnFinishCXXClassDef(DeclTy *D) {