File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed
lib/SILOptimizer/SILCombiner Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -707,6 +707,27 @@ void SwiftPassInvocation::eraseInstruction(SILInstruction *inst) {
707
707
}
708
708
}
709
709
710
+ // The standard library uses _precondition calls which have a message argument.
711
+ //
712
+ // Allow disabling the generated cond_fail by these message arguments.
713
+ //
714
+ // For example:
715
+ //
716
+ // _precondition(source >= (0 as T), "Negative value is not representable")
717
+ // results in a cond_fail "Negative value is not representable".
718
+ //
719
+ // This commit allows for specifying a file that contains these messages on each
720
+ // line.
721
+ //
722
+ // /path/to/disable_cond_fails:
723
+ //
724
+ // ```
725
+ // Negative value is not representable
726
+ // Array index is out of range
727
+ // ```
728
+ //
729
+ // The optimizer will remove these cond_fails if the swift frontend is invoked
730
+ // with -Xllvm -cond-fail-config-file=/path/to/disable_cond_fails.
710
731
static llvm::cl::opt<std::string> CondFailConfigFile (
711
732
" cond-fail-config-file" , llvm::cl::init(" " ),
712
733
llvm::cl::desc(" read the cond_fail message strings to elimimate from file" ));
You can’t perform that action at this time.
0 commit comments