aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGExpr.cpp
diff options
context:
space:
mode:
authorEli Friedman <eli.friedman@gmail.com>2008-05-21 13:24:44 +0000
committerEli Friedman <eli.friedman@gmail.com>2008-05-21 13:24:44 +0000
commit788d571f4de788403d669d373e5c17b8da07b1ad (patch)
treeb2799872f4cd62c30bcd1d14c4d168e2e4bff844 /lib/CodeGen/CGExpr.cpp
parent0ac5957479f1968b1852d7c1e8d3e397ba0d4f0d (diff)
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
Diffstat (limited to 'lib/CodeGen/CGExpr.cpp')
-rw-r--r--lib/CodeGen/CGExpr.cpp10
1 files changed, 4 insertions, 6 deletions
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<llvm::PointerType>(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())