diff options
author | Chris Lattner <sabre@nondot.org> | 2008-03-16 01:16:52 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2008-03-16 01:16:52 +0000 |
commit | 2a52083efc80a68f1318cb7a4178c9d32bcc333a (patch) | |
tree | cd10077a174020d9091b674dee43aa2bc0af25e5 /clang/lib/Sema/SemaDecl.cpp | |
parent | 96c501ef7e314fb0d856b409fb6215581b34415e (diff) | |
download | bcm5719-llvm-2a52083efc80a68f1318cb7a4178c9d32bcc333a.tar.gz bcm5719-llvm-2a52083efc80a68f1318cb7a4178c9d32bcc333a.zip |
hoist a bunch of casting.
llvm-svn: 48409
Diffstat (limited to 'clang/lib/Sema/SemaDecl.cpp')
-rw-r--r-- | clang/lib/Sema/SemaDecl.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp index 5ac51b29bfc..84fe08198f9 100644 --- a/clang/lib/Sema/SemaDecl.cpp +++ b/clang/lib/Sema/SemaDecl.cpp @@ -1291,11 +1291,12 @@ Sema::DeclTy *Sema::ActOnTag(Scope *S, unsigned TagType, TagKind TK, /// ActOnField - Each field of a struct/union/class is passed into this in order /// to create a FieldDecl object for it. -Sema::DeclTy *Sema::ActOnField(Scope *S, DeclTy *TagDecl, +Sema::DeclTy *Sema::ActOnField(Scope *S, DeclTy *tagDecl, SourceLocation DeclStart, Declarator &D, ExprTy *BitfieldWidth) { IdentifierInfo *II = D.getIdentifier(); Expr *BitWidth = (Expr*)BitfieldWidth; + Decl *TagDecl = static_cast<Decl *>(tagDecl); SourceLocation Loc = DeclStart; if (II) Loc = D.getIdentifierLoc(); @@ -1331,15 +1332,15 @@ Sema::DeclTy *Sema::ActOnField(Scope *S, DeclTy *TagDecl, // FIXME: Chain fielddecls together. FieldDecl *NewFD; - if (isa<RecordDecl>(static_cast<Decl *>(TagDecl))) + if (isa<RecordDecl>(TagDecl)) NewFD = FieldDecl::Create(Context, Loc, II, T, BitWidth); - else if (isa<ObjCInterfaceDecl>(static_cast<Decl *>(TagDecl)) || - isa<ObjCImplementationDecl>(static_cast<Decl *>(TagDecl)) || - isa<ObjCCategoryDecl>(static_cast<Decl *>(TagDecl)) || + else if (isa<ObjCInterfaceDecl>(TagDecl) || + isa<ObjCImplementationDecl>(TagDecl) || + isa<ObjCCategoryDecl>(TagDecl) || // FIXME: ivars are currently used to model properties, and // properties can appear within a protocol. // See corresponding FIXME in DeclObjC.h:ObjCPropertyDecl. - isa<ObjCProtocolDecl>(static_cast<Decl *>(TagDecl))) + isa<ObjCProtocolDecl>(TagDecl)) NewFD = ObjCIvarDecl::Create(Context, Loc, II, T); else assert(0 && "Sema::ActOnField(): Unknown TagDecl"); |