SIL: Extend cond_fail by a second operand, which is a static string literal, indicating the failure reason.

This commit is contained in:
Erik Eckstein
2019-07-05 20:02:49 +02:00
parent 08ab7ea732
commit 237a3ef77f
18 changed files with 117 additions and 34 deletions

View File

@@ -712,7 +712,7 @@ struct InductionInfo {
auto ResultTy = SILType::getBuiltinIntegerType(1, Builder.getASTContext());
auto *CmpSGE = Builder.createBuiltinBinaryFunction(
Loc, "cmp_sge", Start->getType(), ResultTy, {Start, End});
Builder.createCondFail(Loc, CmpSGE);
Builder.createCondFail(Loc, CmpSGE, "loop induction variable overflowed");
IsOverflowCheckInserted = true;
// We can now remove the cond fail on the increment the above comparison