]> granicus.if.org Git - clang/commitdiff
Minor changes per Chris L's review.
authorFariborz Jahanian <fjahanian@apple.com>
Fri, 11 Apr 2008 16:55:42 +0000 (16:55 +0000)
committerFariborz Jahanian <fjahanian@apple.com>
Fri, 11 Apr 2008 16:55:42 +0000 (16:55 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49539 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Parse/Action.h
lib/Parse/ParseObjc.cpp
lib/Sema/Sema.h
lib/Sema/SemaDecl.cpp

index 3e915cb6d2419a5edf7734c4574e0f460bed20c8..2243f99c3b59e36d65de2bd9a55bdc9a3e39bb9f 100644 (file)
@@ -201,7 +201,7 @@ public:
   
   virtual DeclTy *ActOnIvar(Scope *S, SourceLocation DeclStart,
                             Declarator &D, ExprTy *BitfieldWidth,
-                            tok::ObjCKeywordKind visibility = tok::objc_not_keyword) {
+                            tok::ObjCKeywordKind visibility) {
     return 0;
   }
   
index eb3c5df6fbe0fd2a940ec100f60748d00d58ee40..4e8790b40fff12dae7e067816eb6974b2196fb21 100644 (file)
@@ -399,7 +399,8 @@ Parser::DeclTy *Parser::ParseObjCPropertyDecl(DeclTy *interfaceDecl,
     // 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);
   }
   
index 3b352bf3545318675c447520840f1d5f2cd1cf4c..1626f0d51c7651077ac914c2d0dab4348abacc19 100644 (file)
@@ -243,7 +243,7 @@ private:
   
   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,
index a7f8bad574c7fb369ad573bacdc634a89d0f2faa..169a5f77fb159f866ecbe9b61762af3b1aea1dba 100644 (file)
@@ -1426,9 +1426,8 @@ Sema::DeclTy *Sema::ActOnField(Scope *S,
     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 @@ TranslateIvarVisibility(tok::ObjCKeywordKind ivarVisibility) {
   }
 }
 
-/// 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 @@ Sema::DeclTy *Sema::ActOnIvar(Scope *S,
     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 @@ Sema::DeclTy *Sema::ActOnIvar(Scope *S,
   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;
 }