From f962808120bd4cf1c684a0936fa1791ce2be73be Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sun, 16 Mar 2008 01:16:52 +0000 Subject: [PATCH] hoist a bunch of casting. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48409 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Sema/SemaDecl.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp index 5ac51b29bf..84fe08198f 100644 --- a/lib/Sema/SemaDecl.cpp +++ b/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(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(static_cast(TagDecl))) + if (isa(TagDecl)) NewFD = FieldDecl::Create(Context, Loc, II, T, BitWidth); - else if (isa(static_cast(TagDecl)) || - isa(static_cast(TagDecl)) || - isa(static_cast(TagDecl)) || + else if (isa(TagDecl) || + isa(TagDecl) || + isa(TagDecl) || // FIXME: ivars are currently used to model properties, and // properties can appear within a protocol. // See corresponding FIXME in DeclObjC.h:ObjCPropertyDecl. - isa(static_cast(TagDecl))) + isa(TagDecl)) NewFD = ObjCIvarDecl::Create(Context, Loc, II, T); else assert(0 && "Sema::ActOnField(): Unknown TagDecl"); -- 2.40.0