aboutsummaryrefslogtreecommitdiff
path: root/lib/AsmParser/LLParser.cpp
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2009-07-22 22:44:56 +0000
committerDan Gohman <gohman@apple.com>2009-07-22 22:44:56 +0000
commit08d012eba490c4906ec773c39db9f2a18a78c997 (patch)
treeef05ab4b5cfa9dd455f4d6b406b4bbacdaeda956 /lib/AsmParser/LLParser.cpp
parent92b78bbc7f2ee919a2d09ed00fd35d1eb7f5f548 (diff)
Rename the new unsigned and signed keywords to nuw and nsw,
which stand for no-unsigned-wrap and no-signed-wrap. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76810 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AsmParser/LLParser.cpp')
-rw-r--r--lib/AsmParser/LLParser.cpp40
1 files changed, 20 insertions, 20 deletions
diff --git a/lib/AsmParser/LLParser.cpp b/lib/AsmParser/LLParser.cpp
index 9f708a860c..bb92b16300 100644
--- a/lib/AsmParser/LLParser.cpp
+++ b/lib/AsmParser/LLParser.cpp
@@ -2045,9 +2045,9 @@ bool LLParser::ParseValID(ValID &ID) {
ID.Kind = ValID::t_Constant;
return false;
}
- case lltok::kw_signed: {
+ case lltok::kw_nuw: {
Lex.Lex();
- bool AlsoUnsigned = EatIfPresent(lltok::kw_unsigned);
+ bool AlsoSigned = EatIfPresent(lltok::kw_nsw);
if (Lex.getKind() != lltok::kw_add &&
Lex.getKind() != lltok::kw_sub &&
Lex.getKind() != lltok::kw_mul)
@@ -2055,16 +2055,16 @@ bool LLParser::ParseValID(ValID &ID) {
bool Result = LLParser::ParseValID(ID);
if (!Result) {
cast<OverflowingBinaryOperator>(ID.ConstantVal)
- ->setHasNoSignedOverflow(true);
- if (AlsoUnsigned)
+ ->setHasNoUnsignedOverflow(true);
+ if (AlsoSigned)
cast<OverflowingBinaryOperator>(ID.ConstantVal)
- ->setHasNoUnsignedOverflow(true);
+ ->setHasNoSignedOverflow(true);
}
return Result;
}
- case lltok::kw_unsigned: {
+ case lltok::kw_nsw: {
Lex.Lex();
- bool AlsoSigned = EatIfPresent(lltok::kw_signed);
+ bool AlsoUnsigned = EatIfPresent(lltok::kw_nuw);
if (Lex.getKind() != lltok::kw_add &&
Lex.getKind() != lltok::kw_sub &&
Lex.getKind() != lltok::kw_mul)
@@ -2072,10 +2072,10 @@ bool LLParser::ParseValID(ValID &ID) {
bool Result = LLParser::ParseValID(ID);
if (!Result) {
cast<OverflowingBinaryOperator>(ID.ConstantVal)
- ->setHasNoUnsignedOverflow(true);
- if (AlsoSigned)
+ ->setHasNoSignedOverflow(true);
+ if (AlsoUnsigned)
cast<OverflowingBinaryOperator>(ID.ConstantVal)
- ->setHasNoSignedOverflow(true);
+ ->setHasNoUnsignedOverflow(true);
}
return Result;
}
@@ -2609,8 +2609,8 @@ bool LLParser::ParseInstruction(Instruction *&Inst, BasicBlock *BB,
return ParseStore(Inst, PFS, true);
else
return TokError("expected 'load' or 'store'");
- case lltok::kw_signed: {
- bool AlsoUnsigned = EatIfPresent(lltok::kw_unsigned);
+ case lltok::kw_nuw: {
+ bool AlsoSigned = EatIfPresent(lltok::kw_nsw);
if (Lex.getKind() == lltok::kw_add ||
Lex.getKind() == lltok::kw_sub ||
Lex.getKind() == lltok::kw_mul) {
@@ -2618,16 +2618,16 @@ bool LLParser::ParseInstruction(Instruction *&Inst, BasicBlock *BB,
KeywordVal = Lex.getUIntVal();
bool Result = ParseArithmetic(Inst, PFS, KeywordVal, 0);
if (!Result) {
- cast<OverflowingBinaryOperator>(Inst)->setHasNoSignedOverflow(true);
- if (AlsoUnsigned)
- cast<OverflowingBinaryOperator>(Inst)->setHasNoUnsignedOverflow(true);
+ cast<OverflowingBinaryOperator>(Inst)->setHasNoUnsignedOverflow(true);
+ if (AlsoSigned)
+ cast<OverflowingBinaryOperator>(Inst)->setHasNoSignedOverflow(true);
}
return Result;
}
return TokError("expected 'add', 'sub', or 'mul'");
}
- case lltok::kw_unsigned: {
- bool AlsoSigned = EatIfPresent(lltok::kw_signed);
+ case lltok::kw_nsw: {
+ bool AlsoUnsigned = EatIfPresent(lltok::kw_nuw);
if (Lex.getKind() == lltok::kw_add ||
Lex.getKind() == lltok::kw_sub ||
Lex.getKind() == lltok::kw_mul) {
@@ -2635,9 +2635,9 @@ bool LLParser::ParseInstruction(Instruction *&Inst, BasicBlock *BB,
KeywordVal = Lex.getUIntVal();
bool Result = ParseArithmetic(Inst, PFS, KeywordVal, 1);
if (!Result) {
- cast<OverflowingBinaryOperator>(Inst)->setHasNoUnsignedOverflow(true);
- if (AlsoSigned)
- cast<OverflowingBinaryOperator>(Inst)->setHasNoSignedOverflow(true);
+ cast<OverflowingBinaryOperator>(Inst)->setHasNoSignedOverflow(true);
+ if (AlsoUnsigned)
+ cast<OverflowingBinaryOperator>(Inst)->setHasNoUnsignedOverflow(true);
}
return Result;
}