SIL: add a failure message operand to Builtin.condfail

The SIL generation for this builtin also changes: instead of generating the cond_fail instructions upfront, let the optimizer generate it, if the operand is a static string literal.
In worst case, if the second operand is not a static string literal, the Builtin.condfail is lowered at the end of the optimization pipeline with a default message: "unknown program error".
This commit is contained in:
Erik Eckstein
2019-07-12 13:30:53 +02:00
parent e2d313ef68
commit 3fd7eea96c
18 changed files with 80 additions and 54 deletions

View File

@@ -129,6 +129,7 @@ static bool isBarrier(SILInstruction *inst) {
case BuiltinValueKind::GetObjCTypeEncoding:
case BuiltinValueKind::Swift3ImplicitObjCEntrypoint:
case BuiltinValueKind::WillThrow:
case BuiltinValueKind::CondFail:
case BuiltinValueKind::PoundAssert:
case BuiltinValueKind::GlobalStringTablePointer:
return false;