[cfe-commits] r49539 - in /cfe/trunk: include/clang/Parse/Action.h lib/Parse/ParseObjc.cpp lib/Sema/Sema.h lib/Sema/SemaDecl.cpp

Fariborz Jahanian fjahanian at apple.com
Fri Apr 11 09:55:42 PDT 2008


Author: fjahanian
Date: Fri Apr 11 11:55:42 2008
New Revision: 49539

URL: http://llvm.org/viewvc/llvm-project?rev=49539&view=rev
Log:
Minor changes per Chris L's review.

Modified:
    cfe/trunk/include/clang/Parse/Action.h
    cfe/trunk/lib/Parse/ParseObjc.cpp
    cfe/trunk/lib/Sema/Sema.h
    cfe/trunk/lib/Sema/SemaDecl.cpp

Modified: cfe/trunk/include/clang/Parse/Action.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Parse/Action.h?rev=49539&r1=49538&r2=49539&view=diff

==============================================================================
--- cfe/trunk/include/clang/Parse/Action.h (original)
+++ cfe/trunk/include/clang/Parse/Action.h Fri Apr 11 11:55:42 2008
@@ -201,7 +201,7 @@
   
   virtual DeclTy *ActOnIvar(Scope *S, SourceLocation DeclStart,
                             Declarator &D, ExprTy *BitfieldWidth,
-                            tok::ObjCKeywordKind visibility = tok::objc_not_keyword) {
+                            tok::ObjCKeywordKind visibility) {
     return 0;
   }
   

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

==============================================================================
--- cfe/trunk/lib/Parse/ParseObjc.cpp (original)
+++ cfe/trunk/lib/Parse/ParseObjc.cpp Fri Apr 11 11:55:42 2008
@@ -399,7 +399,8 @@
     // Install the declarator into interfaceDecl.
     DeclTy *Field = Actions.ActOnIvar(CurScope,
                                        DS.getSourceRange().getBegin(),
-                                      FD.D, FD.BitfieldSize);
+                                      FD.D, FD.BitfieldSize, 
+                                      tok::objc_not_keyword);
     PropertyDecls.push_back(Field);
   }
   

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

==============================================================================
--- cfe/trunk/lib/Sema/Sema.h (original)
+++ cfe/trunk/lib/Sema/Sema.h Fri Apr 11 11:55:42 2008
@@ -243,7 +243,7 @@
   
   virtual DeclTy *ActOnIvar(Scope *S, SourceLocation DeclStart,
                             Declarator &D, ExprTy *BitfieldWidth,
-                            tok::ObjCKeywordKind visibility = tok::objc_not_keyword);
+                            tok::ObjCKeywordKind visibility);
 
   // This is used for both record definitions and ObjC interface declarations.
   virtual void ActOnFields(Scope* S,

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

==============================================================================
--- cfe/trunk/lib/Sema/SemaDecl.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDecl.cpp Fri Apr 11 11:55:42 2008
@@ -1426,9 +1426,8 @@
     InvalidDecl = true;
   }
   // FIXME: Chain fielddecls together.
-  FieldDecl *NewFD;
+  FieldDecl *NewFD = FieldDecl::Create(Context, Loc, II, T, BitWidth);
   
-  NewFD = FieldDecl::Create(Context, Loc, II, T, BitWidth);
   HandleDeclAttributes(NewFD, D.getDeclSpec().getAttributes(),
                        D.getAttributes());
 
@@ -1450,12 +1449,12 @@
   }
 }
 
-/// ActOnIvar - Each field of a struct/union/class is passed into this in order
-/// to create an IvarDecl object for it.
+/// ActOnIvar - Each ivar field of an objective-c class is passed into this 
+/// in order to create an IvarDecl object for it.
 Sema::DeclTy *Sema::ActOnIvar(Scope *S,
-                               SourceLocation DeclStart, 
-                               Declarator &D, ExprTy *BitfieldWidth,
-                              tok::ObjCKeywordKind visibility) {
+                              SourceLocation DeclStart, 
+                              Declarator &D, ExprTy *BitfieldWidth,
+                              tok::ObjCKeywordKind Visibility) {
   IdentifierInfo *II = D.getIdentifier();
   Expr *BitWidth = (Expr*)BitfieldWidth;
   SourceLocation Loc = DeclStart;
@@ -1491,9 +1490,7 @@
     InvalidDecl = true;
   }
   
-  ObjCIvarDecl *NewID;
-  
-  NewID = ObjCIvarDecl::Create(Context, Loc, II, T);
+  ObjCIvarDecl *NewID = ObjCIvarDecl::Create(Context, Loc, II, T);
   
   HandleDeclAttributes(NewID, D.getDeclSpec().getAttributes(),
                        D.getAttributes());
@@ -1501,8 +1498,8 @@
   if (D.getInvalidType() || InvalidDecl)
     NewID->setInvalidDecl();
   // If we have visibility info, make sure the AST is set accordingly.
-  if (visibility != tok::objc_not_keyword)
-    NewID ->setAccessControl(TranslateIvarVisibility(visibility));
+  if (Visibility != tok::objc_not_keyword)
+    NewID->setAccessControl(TranslateIvarVisibility(Visibility));
   return NewID;
 }
 





More information about the cfe-commits mailing list