[llvm-commits] [llvm-gcc-4.0] r43687 - /llvm-gcc-4.0/trunk/gcc/llvm-convert.cpp

Duncan Sands baldrick at free.fr
Sun Nov 4 14:48:54 PST 2007


Author: baldrick
Date: Sun Nov  4 16:48:54 2007
New Revision: 43687

URL: http://llvm.org/viewvc/llvm-project?rev=43687&view=rev
Log:
Remove last uses of getTypeSize.  Since these are
all bitfield accesses all types should be integers,
and since we don't generate funky integer types yet,
there's no need to worry about strange goings on
with the size.  Thus this simple conversion should do.

Modified:
    llvm-gcc-4.0/trunk/gcc/llvm-convert.cpp

Modified: llvm-gcc-4.0/trunk/gcc/llvm-convert.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.0/trunk/gcc/llvm-convert.cpp?rev=43687&r1=43686&r2=43687&view=diff

==============================================================================
--- llvm-gcc-4.0/trunk/gcc/llvm-convert.cpp (original)
+++ llvm-gcc-4.0/trunk/gcc/llvm-convert.cpp Sun Nov  4 16:48:54 2007
@@ -3048,7 +3048,7 @@
   Value *OldVal = LI;
   
   // If the target is big-endian, invert the bit in the word.
-  unsigned ValSizeInBits = TD.getTypeSize(OldVal->getType())*8;
+  unsigned ValSizeInBits = TD.getTypeSizeInBits(OldVal->getType());
   if (BITS_BIG_ENDIAN)
     LV.BitStart = ValSizeInBits-LV.BitStart-LV.BitSize;
 
@@ -5487,7 +5487,7 @@
   unsigned BitSize = (unsigned)TREE_INT_CST_LOW(TREE_OPERAND(exp, 1));
   const Type *ValTy = ConvertType(TREE_TYPE(exp));
   
-  unsigned ValueSizeInBits = 8*TD.getTypeSize(ValTy);
+  unsigned ValueSizeInBits = TD.getTypeSizeInBits(ValTy);
   assert(BitSize <= ValueSizeInBits &&
          "ValTy isn't large enough to hold the value loaded!");
 
@@ -6100,7 +6100,7 @@
     // function to insert (the STy element may be an array of bytes or
     // something).
     const Type *STyFieldTy = STy->getElementType(FieldNo);
-    unsigned STyFieldBitSize = getTargetData().getTypeSize(STyFieldTy)*8;
+    unsigned STyFieldBitSize = getTargetData().getTypeSizeInBits(STyFieldTy);
     
     // If the bitfield starts after this field, advance to the next field.  This
     // can happen because we start looking at the first element overlapped by





More information about the llvm-commits mailing list