summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2007-10-08 15:16:25 +0000
committerDan Gohman <gohman@apple.com>2007-10-08 15:16:25 +0000
commitafedc063abd82ce982c2ed4f1ffa977cae2b2cc7 (patch)
tree01a49f7db0ffe4e1b97c69b1da982756f54d0933 /llvm/lib
parent5e79a6108fa498f1c853ab14127fded2532ca7fa (diff)
downloadbcm5719-llvm-afedc063abd82ce982c2ed4f1ffa977cae2b2cc7.tar.gz
bcm5719-llvm-afedc063abd82ce982c2ed4f1ffa977cae2b2cc7.zip
Simplify getIntPtrType, allowing it to work for arbitrary pointer sizes.
llvm-svn: 42751
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Target/TargetData.cpp7
1 files changed, 1 insertions, 6 deletions
diff --git a/llvm/lib/Target/TargetData.cpp b/llvm/lib/Target/TargetData.cpp
index 0bdb23b5b74..b2d76d84180 100644
--- a/llvm/lib/Target/TargetData.cpp
+++ b/llvm/lib/Target/TargetData.cpp
@@ -565,12 +565,7 @@ unsigned char TargetData::getPreferredTypeAlignmentShift(const Type *Ty) const {
/// getIntPtrType - Return an unsigned integer type that is the same size or
/// greater to the host pointer size.
const Type *TargetData::getIntPtrType() const {
- switch (getPointerSize()) {
- default: assert(0 && "Unknown pointer size!");
- case 2: return Type::Int16Ty;
- case 4: return Type::Int32Ty;
- case 8: return Type::Int64Ty;
- }
+ return IntegerType::get(getPointerSizeInBits());
}
OpenPOWER on IntegriCloud