Add a nothrow flag to the SIL apply_inst.

If the compiler can prove that a throwing function actually does not throw it can
replace a try_apply with an "apply [nothrow]". Such an apply_inst calls a function
with an error result but does not have the overhead of checking for the error case.

Currently this flag is not set, yet.



Swift SVN r31151
This commit is contained in:
Erik Eckstein
2015-08-12 00:18:36 +00:00
parent aee63ec5d3
commit 388bc31ba7
27 changed files with 139 additions and 49 deletions

View File

@@ -777,7 +777,7 @@ ApplyInst *SILGenBuilder::createApply(SILLocation Loc, SILValue Fn,
ArrayRef<Substitution> Subs,
ArrayRef<SILValue> Args) {
SGM.useConformancesFromSubstitutions(Subs);
return SILBuilder::createApply(Loc, Fn, SubstFnTy, Result, Subs, Args);
return SILBuilder::createApply(Loc, Fn, SubstFnTy, Result, Subs, Args, false);
}
TryApplyInst *SILGenBuilder::createTryApply(SILLocation loc, SILValue Fn,