[llvm-commits] [llvm] r168042 - in /llvm/trunk: include/llvm/DataLayout.h lib/VMCore/DataLayout.cpp

Duncan Sands baldrick at free.fr
Thu Nov 15 06:45:30 PST 2012


Author: baldrick
Date: Thu Nov 15 08:45:30 2012
New Revision: 168042

URL: http://llvm.org/viewvc/llvm-project?rev=168042&view=rev
Log:
Do not handle void types in DataLayout.  Patch by Patrick Hägglund.

Modified:
    llvm/trunk/include/llvm/DataLayout.h
    llvm/trunk/lib/VMCore/DataLayout.cpp

Modified: llvm/trunk/include/llvm/DataLayout.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/DataLayout.h?rev=168042&r1=168041&r2=168042&view=diff
==============================================================================
--- llvm/trunk/include/llvm/DataLayout.h (original)
+++ llvm/trunk/include/llvm/DataLayout.h Thu Nov 15 08:45:30 2012
@@ -281,6 +281,7 @@
 
   /// 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

Modified: llvm/trunk/lib/VMCore/DataLayout.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/DataLayout.cpp?rev=168042&r1=168041&r2=168042&view=diff
==============================================================================
--- llvm/trunk/lib/VMCore/DataLayout.cpp (original)
+++ llvm/trunk/lib/VMCore/DataLayout.cpp Thu Nov 15 08:45:30 2012
@@ -537,8 +537,6 @@
     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 @@
     return std::max(Align, Layout->getAlignment());
   }
   case Type::IntegerTyID:
-  case Type::VoidTyID:
     AlignType = INTEGER_ALIGN;
     break;
   case Type::HalfTyID:





More information about the llvm-commits mailing list