summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaDecl.cpp
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2008-04-11 16:55:42 +0000
committerFariborz Jahanian <fjahanian@apple.com>2008-04-11 16:55:42 +0000
commit963767476cc4195e672ef04703a82fe8d1733c5e (patch)
tree797840583562fd80dd8688b9231f1f993895148f /clang/lib/Sema/SemaDecl.cpp
parent0b596c3f5a079729c03456842a49481c469b28cc (diff)
downloadbcm5719-llvm-963767476cc4195e672ef04703a82fe8d1733c5e.tar.gz
bcm5719-llvm-963767476cc4195e672ef04703a82fe8d1733c5e.zip
Minor changes per Chris L's review.
llvm-svn: 49539
Diffstat (limited to 'clang/lib/Sema/SemaDecl.cpp')
-rw-r--r--clang/lib/Sema/SemaDecl.cpp21
1 files changed, 9 insertions, 12 deletions
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp
index a7f8bad574c..169a5f77fb1 100644
--- a/clang/lib/Sema/SemaDecl.cpp
+++ b/clang/lib/Sema/SemaDecl.cpp
@@ -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;
}
OpenPOWER on IntegriCloud