diff options
author | Chris Lattner <sabre@nondot.org> | 2003-04-26 19:47:36 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2003-04-26 19:47:36 +0000 |
commit | 25900cf2203b48ae52956cdbe758419b1973338a (patch) | |
tree | b22d8cc45fa23399a19f7bdf4cf70fc8be42b2a7 /llvm/lib/Target/TargetMachine.cpp | |
parent | 21d4509d76581828c5e76eabdd15b446503a05d8 (diff) | |
download | bcm5719-llvm-25900cf2203b48ae52956cdbe758419b1973338a.tar.gz bcm5719-llvm-25900cf2203b48ae52956cdbe758419b1973338a.zip |
The promotion rules are the same for all targets, they are set by the C standard.
llvm-svn: 5962
Diffstat (limited to 'llvm/lib/Target/TargetMachine.cpp')
-rw-r--r-- | llvm/lib/Target/TargetMachine.cpp | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/llvm/lib/Target/TargetMachine.cpp b/llvm/lib/Target/TargetMachine.cpp index dc722fc7e5c..24788e3c4d9 100644 --- a/llvm/lib/Target/TargetMachine.cpp +++ b/llvm/lib/Target/TargetMachine.cpp @@ -20,16 +20,10 @@ // function TargetMachine::findOptimalStorageSize // -// Purpose: -// This default implementation assumes that all sub-word data items use -// space equal to optSizeForSubWordData, and all other primitive data -// items use space according to the type. -// 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(); + // All integer types smaller than ints promote to 4 byte integers. + if (Ty->isIntegral() && Ty->getPrimitiveSize() < 4) + return 4; return DataLayout.getTypeSize(Ty); } |