summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorEli Friedman <eli.friedman@gmail.com>2008-06-01 15:16:01 +0000
committerEli Friedman <eli.friedman@gmail.com>2008-06-01 15:16:01 +0000
commit149a57f7d44ca05c4d43776b91f9708374366a46 (patch)
tree5bba8bb2abfc2e71076c4d5a0e9348b4a5b8360d /clang/lib
parent3b6dd58ee7d8ff9d7777baeccdee9935186db1e8 (diff)
downloadbcm5719-llvm-149a57f7d44ca05c4d43776b91f9708374366a46.tar.gz
bcm5719-llvm-149a57f7d44ca05c4d43776b91f9708374366a46.zip
Minor cleanup to use the ConvertTypeForMem helper.
llvm-svn: 51837
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/CodeGen/CGExpr.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/clang/lib/CodeGen/CGExpr.cpp b/clang/lib/CodeGen/CGExpr.cpp
index f657d8f2888..8c867d9437f 100644
--- a/clang/lib/CodeGen/CGExpr.cpp
+++ b/clang/lib/CodeGen/CGExpr.cpp
@@ -560,9 +560,7 @@ LValue CodeGenFunction::EmitLValueForField(llvm::Value* BaseValue,
if (Field->isBitField()) {
// FIXME: CodeGenTypes should expose a method to get the appropriate
// type for FieldTy (the appropriate type is ABI-dependent).
- unsigned EltTySize =
- CGM.getTargetData().getABITypeSizeInBits(ConvertType(Field->getType()));
- const llvm::Type *FieldTy = llvm::IntegerType::get(EltTySize);
+ const llvm::Type *FieldTy = CGM.getTypes().ConvertTypeForMem(Field->getType());
const llvm::PointerType *BaseTy =
cast<llvm::PointerType>(BaseValue->getType());
unsigned AS = BaseTy->getAddressSpace();
@@ -578,12 +576,12 @@ LValue CodeGenFunction::EmitLValueForField(llvm::Value* BaseValue,
return LValue::MakeBitfield(V, bitFieldInfo.Begin, bitFieldInfo.Size,
Field->getType()->isSignedIntegerType());
}
-
+
V = Builder.CreateStructGEP(BaseValue, idx, "tmp");
// Match union field type.
if (isUnion) {
- const llvm::Type * FieldTy = ConvertType(Field->getType());
+ const llvm::Type *FieldTy = CGM.getTypes().ConvertTypeForMem(Field->getType());
const llvm::PointerType * BaseTy =
cast<llvm::PointerType>(BaseValue->getType());
unsigned AS = BaseTy->getAddressSpace();
OpenPOWER on IntegriCloud