[llvm-commits] CVS: llvm/lib/Target/TargetData.cpp
Reid Spencer
reid at x10sys.com
Fri Oct 20 00:08:30 PDT 2006
Changes in directory llvm/lib/Target:
TargetData.cpp updated: 1.70 -> 1.71
---
Log message:
For PR950: http://llvm.org/PR950 :
This patch implements the first increment for the Signless Types feature.
All changes pertain to removing the ConstantSInt and ConstantUInt classes
in favor of just using ConstantInt.
---
Diffs of the changes: (+2 -2)
TargetData.cpp | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
Index: llvm/lib/Target/TargetData.cpp
diff -u llvm/lib/Target/TargetData.cpp:1.70 llvm/lib/Target/TargetData.cpp:1.71
--- llvm/lib/Target/TargetData.cpp:1.70 Fri Jun 16 13:22:52 2006
+++ llvm/lib/Target/TargetData.cpp Fri Oct 20 02:07:24 2006
@@ -330,7 +330,7 @@
for (unsigned CurIDX = 0; CurIDX != Idx.size(); ++CurIDX, ++TI) {
if (const StructType *STy = dyn_cast<StructType>(*TI)) {
assert(Idx[CurIDX]->getType() == Type::UIntTy && "Illegal struct idx");
- unsigned FieldNo = cast<ConstantUInt>(Idx[CurIDX])->getValue();
+ unsigned FieldNo = cast<ConstantInt>(Idx[CurIDX])->getZExtValue();
// Get structure layout information...
const StructLayout *Layout = getStructLayout(STy);
@@ -346,7 +346,7 @@
Ty = cast<SequentialType>(Ty)->getElementType();
// Get the array index and the size of each array element.
- int64_t arrayIdx = cast<ConstantInt>(Idx[CurIDX])->getRawValue();
+ int64_t arrayIdx = cast<ConstantInt>(Idx[CurIDX])->getSExtValue();
Result += arrayIdx * (int64_t)getTypeSize(Ty);
}
}
More information about the llvm-commits
mailing list