summaryrefslogtreecommitdiffstats
path: root/llvm/lib/AsmParser/LLParser.cpp
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2009-09-06 00:11:24 +0000
committerDaniel Dunbar <daniel@zuster.org>2009-09-06 00:11:24 +0000
commit10ea8bb8e0934be27ea8894967bf48a8c90cc2bb (patch)
tree845f3759203a7d799922e202b019f5973025fe92 /llvm/lib/AsmParser/LLParser.cpp
parentdb5d4521f56d453d3b91d2446ddac58f8d6f5031 (diff)
downloadbcm5719-llvm-10ea8bb8e0934be27ea8894967bf48a8c90cc2bb.tar.gz
bcm5719-llvm-10ea8bb8e0934be27ea8894967bf48a8c90cc2bb.zip
Revert "Include optional subclass flags, such as inbounds, nsw, etc., ...", this
breaks MiniSAT on x86_64. llvm-svn: 81098
Diffstat (limited to 'llvm/lib/AsmParser/LLParser.cpp')
-rw-r--r--llvm/lib/AsmParser/LLParser.cpp30
1 files changed, 15 insertions, 15 deletions
diff --git a/llvm/lib/AsmParser/LLParser.cpp b/llvm/lib/AsmParser/LLParser.cpp
index b7b95d7ecf0..3ef4aaf6498 100644
--- a/llvm/lib/AsmParser/LLParser.cpp
+++ b/llvm/lib/AsmParser/LLParser.cpp
@@ -2095,11 +2095,13 @@ bool LLParser::ParseValID(ValID &ID) {
if (!Val0->getType()->isIntOrIntVector() &&
!Val0->getType()->isFPOrFPVector())
return Error(ID.Loc,"constexpr requires integer, fp, or vector operands");
- unsigned Flags = 0;
- if (NUW) Flags |= OverflowingBinaryOperator::NoUnsignedWrap;
- if (NSW) Flags |= OverflowingBinaryOperator::NoSignedWrap;
- if (Exact) Flags |= SDivOperator::IsExact;
- Constant *C = ConstantExpr::get(Opc, Val0, Val1, Flags);
+ Constant *C = ConstantExpr::get(Opc, Val0, Val1);
+ if (NUW)
+ cast<OverflowingBinaryOperator>(C)->setHasNoUnsignedWrap(true);
+ if (NSW)
+ cast<OverflowingBinaryOperator>(C)->setHasNoSignedWrap(true);
+ if (Exact)
+ cast<SDivOperator>(C)->setIsExact(true);
ID.ConstantVal = C;
ID.Kind = ValID::t_Constant;
return false;
@@ -2155,12 +2157,10 @@ bool LLParser::ParseValID(ValID &ID) {
(Value**)(Elts.data() + 1),
Elts.size() - 1))
return Error(ID.Loc, "invalid indices for getelementptr");
- ID.ConstantVal = InBounds ?
- ConstantExpr::getInBoundsGetElementPtr(Elts[0],
- Elts.data() + 1,
- Elts.size() - 1) :
- ConstantExpr::getGetElementPtr(Elts[0],
- Elts.data() + 1, Elts.size() - 1);
+ ID.ConstantVal = ConstantExpr::getGetElementPtr(Elts[0],
+ Elts.data() + 1, Elts.size() - 1);
+ if (InBounds)
+ cast<GEPOperator>(ID.ConstantVal)->setIsInBounds(true);
} else if (Opc == Instruction::Select) {
if (Elts.size() != 3)
return Error(ID.Loc, "expected three operands to select");
@@ -2681,9 +2681,9 @@ bool LLParser::ParseInstruction(Instruction *&Inst, BasicBlock *BB,
return Error(ModifierLoc, "nsw only applies to integer operations");
}
if (NUW)
- cast<BinaryOperator>(Inst)->setHasNoUnsignedWrap(true);
+ cast<OverflowingBinaryOperator>(Inst)->setHasNoUnsignedWrap(true);
if (NSW)
- cast<BinaryOperator>(Inst)->setHasNoSignedWrap(true);
+ cast<OverflowingBinaryOperator>(Inst)->setHasNoSignedWrap(true);
}
return Result;
}
@@ -2698,7 +2698,7 @@ bool LLParser::ParseInstruction(Instruction *&Inst, BasicBlock *BB,
bool Result = ParseArithmetic(Inst, PFS, KeywordVal, 1);
if (!Result)
if (Exact)
- cast<BinaryOperator>(Inst)->setIsExact(true);
+ cast<SDivOperator>(Inst)->setIsExact(true);
return Result;
}
@@ -3501,7 +3501,7 @@ bool LLParser::ParseGetElementPtr(Instruction *&Inst, PerFunctionState &PFS) {
return Error(Loc, "invalid getelementptr indices");
Inst = GetElementPtrInst::Create(Ptr, Indices.begin(), Indices.end());
if (InBounds)
- cast<GetElementPtrInst>(Inst)->setIsInBounds(true);
+ cast<GEPOperator>(Inst)->setIsInBounds(true);
return false;
}
OpenPOWER on IntegriCloud