summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/TargetData.cpp
diff options
context:
space:
mode:
authorReid Spencer <rspencer@reidspencer.com>2007-02-05 23:51:43 +0000
committerReid Spencer <rspencer@reidspencer.com>2007-02-05 23:51:43 +0000
commit92b50800f6ebd5354e8e2e8b876855265d10625c (patch)
tree514df21070aef1aff51754cf4694228007dd40b3 /llvm/lib/Target/TargetData.cpp
parentd7a00d741402208e4abb99c79a9c64f597f89715 (diff)
downloadbcm5719-llvm-92b50800f6ebd5354e8e2e8b876855265d10625c.tar.gz
bcm5719-llvm-92b50800f6ebd5354e8e2e8b876855265d10625c.zip
Although targets are not required to support integers > 64bits, TargetData
must in order for backends that do want to support large integer types to be able to function. Consequently, don't assert if the bitwidth > 64 bits when computing the size and alignment. Instead, compute the size by rounding up to the next even number of bytes for the size. Compute the alignment as the same as the LongABIAlignment. These provide reasonable defaults that the target can override. llvm-svn: 33943
Diffstat (limited to 'llvm/lib/Target/TargetData.cpp')
-rw-r--r--llvm/lib/Target/TargetData.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/llvm/lib/Target/TargetData.cpp b/llvm/lib/Target/TargetData.cpp
index 559f4d04904..aa32530d4b5 100644
--- a/llvm/lib/Target/TargetData.cpp
+++ b/llvm/lib/Target/TargetData.cpp
@@ -295,8 +295,10 @@ static inline void getTypeInfoABI(const Type *Ty, const TargetData *TD,
Size = 4; Alignment = TD->getIntABIAlignment();
} else if (BitWidth <= 64) {
Size = 8; Alignment = TD->getLongABIAlignment();
- } else
- assert(0 && "Integer types > 64 bits not supported.");
+ } else {
+ Size = ((BitWidth + 7) / 8) & ~1;
+ Alignment = TD->getLongABIAlignment();
+ }
return;
}
case Type::VoidTyID: Size = 1; Alignment = TD->getByteABIAlignment(); return;
OpenPOWER on IntegriCloud