Do not handle void types in DataLayout. Patch by Patrick Hägglund.
authorDuncan Sands <baldrick@free.fr>
Thu, 15 Nov 2012 14:45:30 +0000 (14:45 +0000)
committerDuncan Sands <baldrick@free.fr>
Thu, 15 Nov 2012 14:45:30 +0000 (14:45 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168042 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/DataLayout.h
lib/VMCore/DataLayout.cpp

index 7d8eace1b62854791ce1a6bf0fa9ee099976ae3c..e10f9c74c96d6d624057c61ed2648bb7f1c77d13 100644 (file)
@@ -281,6 +281,7 @@ public:
 
   /// getTypeSizeInBits - Return the number of bits necessary to hold the
   /// specified type.  For example, returns 36 for i36 and 80 for x86_fp80.
+  /// The type passed must have a size (Type::isSized() must return true).
   uint64_t getTypeSizeInBits(Type* Ty) const;
 
   /// getTypeStoreSize - Return the maximum number of bytes that may be
index 72dcb99b6d8c01e7a4bd7fb06d6eb07608e79956..24111be31623c54a014997a92f65c25f0fd0cf8e 100644 (file)
@@ -537,8 +537,6 @@ uint64_t DataLayout::getTypeSizeInBits(Type *Ty) const {
     return getStructLayout(cast<StructType>(Ty))->getSizeInBits();
   case Type::IntegerTyID:
     return cast<IntegerType>(Ty)->getBitWidth();
-  case Type::VoidTyID:
-    return 8;
   case Type::HalfTyID:
     return 16;
   case Type::FloatTyID:
@@ -600,7 +598,6 @@ unsigned DataLayout::getAlignment(Type *Ty, bool abi_or_pref) const {
     return std::max(Align, Layout->getAlignment());
   }
   case Type::IntegerTyID:
-  case Type::VoidTyID:
     AlignType = INTEGER_ALIGN;
     break;
   case Type::HalfTyID: