]> granicus.if.org Git - clang/commitdiff
Minor cleanup to use the ConvertTypeForMem helper.
authorEli Friedman <eli.friedman@gmail.com>
Sun, 1 Jun 2008 15:16:01 +0000 (15:16 +0000)
committerEli Friedman <eli.friedman@gmail.com>
Sun, 1 Jun 2008 15:16:01 +0000 (15:16 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51837 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGExpr.cpp

index f657d8f28887a82ddd41cdf79ed325d7c942d8a9..8c867d9437f60622083fa3ab7961f1028363f269 100644 (file)
@@ -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();