aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/AsmParser/LLLexer.cpp4
-rw-r--r--lib/AsmParser/LLParser.cpp40
-rw-r--r--lib/AsmParser/LLToken.h4
-rw-r--r--lib/VMCore/AsmWriter.cpp4
4 files changed, 26 insertions, 26 deletions
diff --git a/lib/AsmParser/LLLexer.cpp b/lib/AsmParser/LLLexer.cpp
index 313213cb48..e047002c13 100644
--- a/lib/AsmParser/LLLexer.cpp
+++ b/lib/AsmParser/LLLexer.cpp
@@ -501,8 +501,8 @@ lltok::Kind LLLexer::LexIdentifier() {
KEYWORD(deplibs);
KEYWORD(datalayout);
KEYWORD(volatile);
- KEYWORD(signed);
- KEYWORD(unsigned);
+ KEYWORD(nuw);
+ KEYWORD(nsw);
KEYWORD(exact);
KEYWORD(align);
KEYWORD(addrspace);
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;
}
diff --git a/lib/AsmParser/LLToken.h b/lib/AsmParser/LLToken.h
index b78a09d43e..c8cdff6bf6 100644
--- a/lib/AsmParser/LLToken.h
+++ b/lib/AsmParser/LLToken.h
@@ -51,8 +51,8 @@ namespace lltok {
kw_deplibs,
kw_datalayout,
kw_volatile,
- kw_signed,
- kw_unsigned,
+ kw_nuw,
+ kw_nsw,
kw_exact,
kw_align,
kw_addrspace,
diff --git a/lib/VMCore/AsmWriter.cpp b/lib/VMCore/AsmWriter.cpp
index 6e84af3211..d9d8cc834d 100644
--- a/lib/VMCore/AsmWriter.cpp
+++ b/lib/VMCore/AsmWriter.cpp
@@ -856,9 +856,9 @@ static void WriteOptimizationInfo(raw_ostream &Out, const User *U) {
if (const OverflowingBinaryOperator *OBO =
dyn_cast<OverflowingBinaryOperator>(U)) {
if (OBO->hasNoUnsignedOverflow())
- Out << "unsigned ";
+ Out << "nuw ";
if (OBO->hasNoSignedOverflow())
- Out << "signed ";
+ Out << "nsw ";
} else if (const SDivOperator *Div = dyn_cast<SDivOperator>(U)) {
if (Div->isExact())
Out << "exact ";