From 5669218d7a1344f2aa8fe1f7844c72744b6488e8 Mon Sep 17 00:00:00 2001 From: Duncan Sands Date: Thu, 15 Nov 2012 14:45:30 +0000 Subject: [PATCH] =?utf8?q?Do=20not=20handle=20void=20types=20in=20DataLayo?= =?utf8?q?ut.=20=20Patch=20by=20Patrick=20H=C3=A4gglund.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit llvm-svn: 168042 --- llvm/include/llvm/DataLayout.h | 1 + llvm/lib/VMCore/DataLayout.cpp | 3 --- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/llvm/include/llvm/DataLayout.h b/llvm/include/llvm/DataLayout.h index 7d8eace..e10f9c7 100644 --- a/llvm/include/llvm/DataLayout.h +++ b/llvm/include/llvm/DataLayout.h @@ -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 diff --git a/llvm/lib/VMCore/DataLayout.cpp b/llvm/lib/VMCore/DataLayout.cpp index 72dcb99..24111be 100644 --- a/llvm/lib/VMCore/DataLayout.cpp +++ b/llvm/lib/VMCore/DataLayout.cpp @@ -537,8 +537,6 @@ uint64_t DataLayout::getTypeSizeInBits(Type *Ty) const { return getStructLayout(cast(Ty))->getSizeInBits(); case Type::IntegerTyID: return cast(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: -- 2.7.4