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";
}
/// 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!");
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);
}
// 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;
}
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,
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);
SourceLocation RBrac) {
ActOnFields(S, RLoc, TagDecl,
(DeclTy**)FieldCollector->getCurFields(),
- FieldCollector->getCurNumFields(), LBrac, RBrac);
+ FieldCollector->getCurNumFields(), LBrac, RBrac, 0);
}
void Sema::ActOnFinishCXXClassDef(DeclTy *D) {