[llvm-commits] CVS: llvm/lib/AsmParser/llvmAsmParser.y
Reid Spencer
reid at x10sys.com
Mon Mar 19 13:40:39 PDT 2007
Changes in directory llvm/lib/AsmParser:
llvmAsmParser.y updated: 1.328 -> 1.329
---
Log message:
Fix test/Assembler/2007-03-19-NegValue.ll by using the new "isSigned"
parameter on ConstantInt::get to indicate the signedness of the intended
value.
---
Diffs of the changes: (+4 -9)
llvmAsmParser.y | 13 ++++---------
1 files changed, 4 insertions(+), 9 deletions(-)
Index: llvm/lib/AsmParser/llvmAsmParser.y
diff -u llvm/lib/AsmParser/llvmAsmParser.y:1.328 llvm/lib/AsmParser/llvmAsmParser.y:1.329
--- llvm/lib/AsmParser/llvmAsmParser.y:1.328 Mon Mar 19 13:39:36 2007
+++ llvm/lib/AsmParser/llvmAsmParser.y Mon Mar 19 15:40:22 2007
@@ -392,7 +392,7 @@
Ty->getDescription() + "'");
return 0;
}
- return ConstantInt::get(Ty, D.ConstPool64);
+ return ConstantInt::get(Ty, D.ConstPool64, true);
case ValID::ConstUIntVal: // Is it an unsigned const pool reference?
if (!ConstantInt::isValueValidForType(Ty, D.UConstPool64)) {
@@ -401,7 +401,7 @@
"' is invalid or out of range");
return 0;
} else { // This is really a signed reference. Transmogrify.
- return ConstantInt::get(Ty, D.ConstPool64);
+ return ConstantInt::get(Ty, D.ConstPool64, true);
}
} else {
return ConstantInt::get(Ty, D.UConstPool64);
@@ -1742,10 +1742,7 @@
| IntType ESINT64VAL { // integral constants
if (!ConstantInt::isValueValidForType($1, $2))
GEN_ERROR("Constant value doesn't fit in type");
- APInt Val(64, $2);
- uint32_t BitWidth = cast<IntegerType>($1)->getBitWidth();
- Val.sextOrTrunc(BitWidth);
- $$ = ConstantInt::get(Val);
+ $$ = ConstantInt::get($1, $2, true);
CHECK_FOR_ERROR
}
| IntType ESAPINTVAL { // arbitrary precision integer constants
@@ -1761,9 +1758,7 @@
| IntType EUINT64VAL { // integral constants
if (!ConstantInt::isValueValidForType($1, $2))
GEN_ERROR("Constant value doesn't fit in type");
- uint32_t BitWidth = cast<IntegerType>($1)->getBitWidth();
- APInt Val(BitWidth, $2);
- $$ = ConstantInt::get(Val);
+ $$ = ConstantInt::get($1, $2, false);
CHECK_FOR_ERROR
}
| IntType EUAPINTVAL { // arbitrary precision integer constants
More information about the llvm-commits
mailing list