]> granicus.if.org Git - clang/commitdiff
Pass postfix attributes to ActOnFields.
authorDaniel Dunbar <daniel@zuster.org>
Fri, 3 Oct 2008 02:03:53 +0000 (02:03 +0000)
committerDaniel Dunbar <daniel@zuster.org>
Fri, 3 Oct 2008 02:03:53 +0000 (02:03 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56992 91177308-0d34-0410-b5e6-96231b3b80d8

Driver/PrintParserCallbacks.cpp
lib/AST/ASTContext.cpp
lib/Parse/ParseDecl.cpp
lib/Parse/ParseObjc.cpp
lib/Sema/Sema.h
lib/Sema/SemaDecl.cpp
lib/Sema/SemaDeclCXX.cpp

index caae11b861ef27b0454fa87956330f3e0f094889..b616268376f900780761b69f8c095f6302c6be98 100644 (file)
@@ -205,7 +205,8 @@ namespace {
   
     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";
     }
   
index feb1bad4f95943d38f3b1ddc3abf99c57171c41a..b373f3ac2ab1d6b4a30867b2a3575dfc1a16adc9 100644 (file)
@@ -492,6 +492,8 @@ ASTContext::getASTObjCInterfaceLayout(const ObjCInterfaceDecl *D) {
 /// 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!");
 
index 80970a2f14d880682db1f1fb23a2eb5159836807..5ea9d13b031a9be40165a832361f0c3be2a95e88 100644 (file)
@@ -764,14 +764,15 @@ void Parser::ParseStructUnionBody(SourceLocation RecordLoc,
   
   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);  
 }
 
 
index c48cc8aa1ab4aa4ddff250e200d2be31431f3451..0222b0401a5e6013981fb8631176376bddabeff2 100644 (file)
@@ -900,7 +900,7 @@ void Parser::ParseObjCClassInstanceVariables(DeclTy *interfaceDecl,
   // 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;
 }
 
index 696a6f419412e777cdce14fb203cd0f6607ed332..36f5de8bb322de0d8aa3dc223fbebb4dd8b1cf3f 100644 (file)
@@ -282,7 +282,8 @@ private:
   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,
index 1d755efd1213ca054ca8f3e79ee8ed7bcc2f244c..315bf98af5af774a949dfe4099a1900118e3ecf3 100644 (file)
@@ -2111,7 +2111,8 @@ Sema::DeclTy *Sema::ActOnIvar(Scope *S,
 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);
index 85097cabd4f543780307f74b26002a31e89b6e3d..c46954568f01283eb6514a2bde3b7fcce04f8997 100644 (file)
@@ -461,7 +461,7 @@ void Sema::ActOnFinishCXXMemberSpecification(Scope* S, SourceLocation RLoc,
                                              SourceLocation RBrac) {
   ActOnFields(S, RLoc, TagDecl,
               (DeclTy**)FieldCollector->getCurFields(),
-              FieldCollector->getCurNumFields(), LBrac, RBrac);
+              FieldCollector->getCurNumFields(), LBrac, RBrac, 0);
 }
 
 void Sema::ActOnFinishCXXClassDef(DeclTy *D) {