mirror of
https://github.com/RPCS3/llvm.git
synced 2024-12-15 07:59:57 +00:00
Implement findOptimalStorageSize a bit more generally
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4416 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
6334205cb5
commit
62eaf7ef60
@ -25,21 +25,13 @@
|
||||
// space equal to optSizeForSubWordData, and all other primitive data
|
||||
// items use space according to the type.
|
||||
//
|
||||
unsigned int
|
||||
TargetMachine::findOptimalStorageSize(const Type* ty) const
|
||||
{
|
||||
switch(ty->getPrimitiveID())
|
||||
{
|
||||
case Type::BoolTyID:
|
||||
case Type::UByteTyID:
|
||||
case Type::SByteTyID:
|
||||
case Type::UShortTyID:
|
||||
case Type::ShortTyID:
|
||||
return optSizeForSubWordData;
|
||||
|
||||
default:
|
||||
return DataLayout.getTypeSize(ty);
|
||||
}
|
||||
unsigned TargetMachine::findOptimalStorageSize(const Type *Ty) const {
|
||||
// Round integral values smaller than SubWordDataSize up to SubWordDataSize
|
||||
if (Ty->isIntegral() &&
|
||||
Ty->getPrimitiveSize() < DataLayout.getSubWordDataSize())
|
||||
return DataLayout.getSubWordDataSize();
|
||||
|
||||
return DataLayout.getTypeSize(Ty);
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user