[cfe-commits] r51837 - /cfe/trunk/lib/CodeGen/CGExpr.cpp

Eli Friedman eli.friedman at gmail.com
Sun Jun 1 08:16:01 PDT 2008


Author: efriedma
Date: Sun Jun  1 10:16:01 2008
New Revision: 51837

URL: http://llvm.org/viewvc/llvm-project?rev=51837&view=rev
Log:
Minor cleanup to use the ConvertTypeForMem helper.


Modified:
    cfe/trunk/lib/CodeGen/CGExpr.cpp

Modified: cfe/trunk/lib/CodeGen/CGExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGExpr.cpp?rev=51837&r1=51836&r2=51837&view=diff

==============================================================================
--- cfe/trunk/lib/CodeGen/CGExpr.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGExpr.cpp Sun Jun  1 10:16:01 2008
@@ -560,9 +560,7 @@
   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 @@
     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();





More information about the cfe-commits mailing list