forked from OSchip/llvm-project
Do not handle void types in DataLayout. Patch by Patrick Hägglund.
llvm-svn: 168042
This commit is contained in:
parent
b2aa9234b6
commit
5669218d7a
|
@ -281,6 +281,7 @@ public:
|
||||||
|
|
||||||
/// getTypeSizeInBits - Return the number of bits necessary to hold the
|
/// getTypeSizeInBits - Return the number of bits necessary to hold the
|
||||||
/// specified type. For example, returns 36 for i36 and 80 for x86_fp80.
|
/// 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;
|
uint64_t getTypeSizeInBits(Type* Ty) const;
|
||||||
|
|
||||||
/// getTypeStoreSize - Return the maximum number of bytes that may be
|
/// getTypeStoreSize - Return the maximum number of bytes that may be
|
||||||
|
|
|
@ -537,8 +537,6 @@ uint64_t DataLayout::getTypeSizeInBits(Type *Ty) const {
|
||||||
return getStructLayout(cast<StructType>(Ty))->getSizeInBits();
|
return getStructLayout(cast<StructType>(Ty))->getSizeInBits();
|
||||||
case Type::IntegerTyID:
|
case Type::IntegerTyID:
|
||||||
return cast<IntegerType>(Ty)->getBitWidth();
|
return cast<IntegerType>(Ty)->getBitWidth();
|
||||||
case Type::VoidTyID:
|
|
||||||
return 8;
|
|
||||||
case Type::HalfTyID:
|
case Type::HalfTyID:
|
||||||
return 16;
|
return 16;
|
||||||
case Type::FloatTyID:
|
case Type::FloatTyID:
|
||||||
|
@ -600,7 +598,6 @@ unsigned DataLayout::getAlignment(Type *Ty, bool abi_or_pref) const {
|
||||||
return std::max(Align, Layout->getAlignment());
|
return std::max(Align, Layout->getAlignment());
|
||||||
}
|
}
|
||||||
case Type::IntegerTyID:
|
case Type::IntegerTyID:
|
||||||
case Type::VoidTyID:
|
|
||||||
AlignType = INTEGER_ALIGN;
|
AlignType = INTEGER_ALIGN;
|
||||||
break;
|
break;
|
||||||
case Type::HalfTyID:
|
case Type::HalfTyID:
|
||||||
|
|
Loading…
Reference in New Issue