[cfe-commits] r56992 - in /cfe/trunk: 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

Daniel Dunbar daniel at zuster.org
Thu Oct 2 19:03:53 PDT 2008


Author: ddunbar
Date: Thu Oct  2 21:03:53 2008
New Revision: 56992

URL: http://llvm.org/viewvc/llvm-project?rev=56992&view=rev
Log:
Pass postfix attributes to ActOnFields.

Modified:
    cfe/trunk/Driver/PrintParserCallbacks.cpp
    cfe/trunk/lib/AST/ASTContext.cpp
    cfe/trunk/lib/Parse/ParseDecl.cpp
    cfe/trunk/lib/Parse/ParseObjc.cpp
    cfe/trunk/lib/Sema/Sema.h
    cfe/trunk/lib/Sema/SemaDecl.cpp
    cfe/trunk/lib/Sema/SemaDeclCXX.cpp

Modified: cfe/trunk/Driver/PrintParserCallbacks.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/Driver/PrintParserCallbacks.cpp?rev=56992&r1=56991&r2=56992&view=diff

==============================================================================
--- cfe/trunk/Driver/PrintParserCallbacks.cpp (original)
+++ cfe/trunk/Driver/PrintParserCallbacks.cpp Thu Oct  2 21:03:53 2008
@@ -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";
     }
   

Modified: cfe/trunk/lib/AST/ASTContext.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/ASTContext.cpp?rev=56992&r1=56991&r2=56992&view=diff

==============================================================================
--- cfe/trunk/lib/AST/ASTContext.cpp (original)
+++ cfe/trunk/lib/AST/ASTContext.cpp Thu Oct  2 21:03:53 2008
@@ -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!");
 

Modified: cfe/trunk/lib/Parse/ParseDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseDecl.cpp?rev=56992&r1=56991&r2=56992&view=diff

==============================================================================
--- cfe/trunk/lib/Parse/ParseDecl.cpp (original)
+++ cfe/trunk/lib/Parse/ParseDecl.cpp Thu Oct  2 21:03:53 2008
@@ -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);  
 }
 
 

Modified: cfe/trunk/lib/Parse/ParseObjc.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseObjc.cpp?rev=56992&r1=56991&r2=56992&view=diff

==============================================================================
--- cfe/trunk/lib/Parse/ParseObjc.cpp (original)
+++ cfe/trunk/lib/Parse/ParseObjc.cpp Thu Oct  2 21:03:53 2008
@@ -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;
 }
 

Modified: cfe/trunk/lib/Sema/Sema.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/Sema.h?rev=56992&r1=56991&r2=56992&view=diff

==============================================================================
--- cfe/trunk/lib/Sema/Sema.h (original)
+++ cfe/trunk/lib/Sema/Sema.h Thu Oct  2 21:03:53 2008
@@ -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,

Modified: cfe/trunk/lib/Sema/SemaDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDecl.cpp?rev=56992&r1=56991&r2=56992&view=diff

==============================================================================
--- cfe/trunk/lib/Sema/SemaDecl.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDecl.cpp Thu Oct  2 21:03:53 2008
@@ -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);

Modified: cfe/trunk/lib/Sema/SemaDeclCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDeclCXX.cpp?rev=56992&r1=56991&r2=56992&view=diff

==============================================================================
--- cfe/trunk/lib/Sema/SemaDeclCXX.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDeclCXX.cpp Thu Oct  2 21:03:53 2008
@@ -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) {





More information about the cfe-commits mailing list