mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-19 04:32:19 +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
|
// space equal to optSizeForSubWordData, and all other primitive data
|
||||||
// items use space according to the type.
|
// items use space according to the type.
|
||||||
//
|
//
|
||||||
unsigned int
|
unsigned TargetMachine::findOptimalStorageSize(const Type *Ty) const {
|
||||||
TargetMachine::findOptimalStorageSize(const Type* ty) const
|
// Round integral values smaller than SubWordDataSize up to SubWordDataSize
|
||||||
{
|
if (Ty->isIntegral() &&
|
||||||
switch(ty->getPrimitiveID())
|
Ty->getPrimitiveSize() < DataLayout.getSubWordDataSize())
|
||||||
{
|
return DataLayout.getSubWordDataSize();
|
||||||
case Type::BoolTyID:
|
|
||||||
case Type::UByteTyID:
|
return DataLayout.getTypeSize(Ty);
|
||||||
case Type::SByteTyID:
|
|
||||||
case Type::UShortTyID:
|
|
||||||
case Type::ShortTyID:
|
|
||||||
return optSizeForSubWordData;
|
|
||||||
|
|
||||||
default:
|
|
||||||
return DataLayout.getTypeSize(ty);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user