diff options
author | Reid Spencer <rspencer@reidspencer.com> | 2007-03-19 20:40:22 +0000 |
---|---|---|
committer | Reid Spencer <rspencer@reidspencer.com> | 2007-03-19 20:40:22 +0000 |
commit | eac65746d76fb31d911df289f0fe4b00292774aa (patch) | |
tree | ca42b9a4b165ca7d97f250e80e61494ca1f7b022 | |
parent | 7fc44c8c5fb0efd6c909f4e306ad516df88e93e1 (diff) |
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35182 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/AsmParser/llvmAsmParser.y | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/lib/AsmParser/llvmAsmParser.y b/lib/AsmParser/llvmAsmParser.y index b929067c37..aac87d6c6b 100644 --- a/lib/AsmParser/llvmAsmParser.y +++ b/lib/AsmParser/llvmAsmParser.y @@ -392,7 +392,7 @@ static Value *getExistingVal(const Type *Ty, const ValID &D) { 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 @@ static Value *getExistingVal(const Type *Ty, const ValID &D) { "' 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 @@ ConstVal: Types '[' ConstVector ']' { // Nonempty unsized arr | 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 @@ ConstVal: Types '[' ConstVector ']' { // Nonempty unsized arr | 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 |