diff options
author | Dan Gohman <gohman@apple.com> | 2007-10-08 15:16:25 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2007-10-08 15:16:25 +0000 |
commit | 8e41ed7c4e8513487b8727554dbb3e4ad7400dd5 (patch) | |
tree | 95310ffae0f160797724e8e84f1514ce7425e03e /lib/Target/TargetData.cpp | |
parent | c318329a1098a19137398af4d880f4d8cdd9cd8d (diff) |
Simplify getIntPtrType, allowing it to work for arbitrary pointer sizes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42751 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/TargetData.cpp')
-rw-r--r-- | lib/Target/TargetData.cpp | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/lib/Target/TargetData.cpp b/lib/Target/TargetData.cpp index 0bdb23b5b7..b2d76d8418 100644 --- a/lib/Target/TargetData.cpp +++ b/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()); } |