[llvm-commits] CVS: llvm/lib/Target/TargetData.cpp
Reid Spencer
reid at x10sys.com
Mon Feb 5 15:52:04 PST 2007
Changes in directory llvm/lib/Target:
TargetData.cpp updated: 1.84 -> 1.85
---
Log message:
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.
---
Diffs of the changes: (+4 -2)
TargetData.cpp | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
Index: llvm/lib/Target/TargetData.cpp
diff -u llvm/lib/Target/TargetData.cpp:1.84 llvm/lib/Target/TargetData.cpp:1.85
--- llvm/lib/Target/TargetData.cpp:1.84 Wed Jan 31 15:31:25 2007
+++ llvm/lib/Target/TargetData.cpp Mon Feb 5 17:51:43 2007
@@ -295,8 +295,10 @@
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;
More information about the llvm-commits
mailing list