mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-30 08:44:48 +00:00
Implement findOptimalStorageSize a bit more generally
llvm-svn: 4416
This commit is contained in:
parent
eec571dce8
commit
94fb0d4b03
@ -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…
x
Reference in New Issue
Block a user