From: Eli Friedman Date: Wed, 21 May 2008 13:24:44 +0000 (+0000) Subject: Remove an unnecessary/buggy if check. Ran into this with some other X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=788d571f4de788403d669d373e5c17b8da07b1ad;p=clang Remove an unnecessary/buggy if check. Ran into this with some other changes in my tree, so I don't have a testcase which affects trunk. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51371 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/CGExpr.cpp b/lib/CodeGen/CGExpr.cpp index 8d36c8e26d..7fa2e37d9e 100644 --- a/lib/CodeGen/CGExpr.cpp +++ b/lib/CodeGen/CGExpr.cpp @@ -571,12 +571,10 @@ LValue CodeGenFunction::EmitLValueForField(llvm::Value* BaseValue, const llvm::Type * FieldTy = ConvertType(Field->getType()); const llvm::PointerType * BaseTy = cast(BaseValue->getType()); - if (FieldTy != BaseTy->getElementType()) { - unsigned AS = BaseTy->getAddressSpace(); - V = Builder.CreateBitCast(V, - llvm::PointerType::get(FieldTy, AS), - "tmp"); - } + unsigned AS = BaseTy->getAddressSpace(); + V = Builder.CreateBitCast(V, + llvm::PointerType::get(FieldTy, AS), + "tmp"); } if (!Field->isBitField())