@@ -474,6 +474,29 @@ class ApplySite {
474
474
llvm_unreachable (" covered switch" );
475
475
}
476
476
477
+ // / If this is a terminator apply site, then pass a builder to insert at the
478
+ // / first instruction of each successor to \p func. Otherwise, pass a builder
479
+ // / to insert at std::next(Inst).
480
+ // /
481
+ // / The intention is that this abstraction will enable the compiler writer to
482
+ // / ignore whether or not an apply site is a terminator when inserting
483
+ // / instructions after an apply site. This results in eliminating unnecessary
484
+ // / if-else code otherwise required to handle such situations.
485
+ // /
486
+ // / NOTE: We pass std::next() for begin_apply. If one wishes to insert code
487
+ // / /after/ the end_apply/abort_apply, please use instead
488
+ // / insertAfterFullEvaluation.
489
+ void insertAfterInvocation (function_ref<void (SILBuilder &)> func) const ;
490
+
491
+ // / Pass a builder with insertion points that are guaranteed to be immediately
492
+ // / after this full apply site has completely finished executing.
493
+ // /
494
+ // / This is just like insertAfterInvocation except that if the full apply site
495
+ // / is a begin_apply, we pass the insertion points after the end_apply,
496
+ // / abort_apply rather than an insertion point right after the
497
+ // / begin_apply. For such functionality, please invoke insertAfterInvocation.
498
+ void insertAfterFullEvaluation (function_ref<void (SILBuilder &)> func) const ;
499
+
477
500
// / Return whether the given apply is of a formally-throwing function
478
501
// / which is statically known not to throw.
479
502
bool isNonThrowing () const {
@@ -660,29 +683,6 @@ class FullApplySite : public ApplySite {
660
683
llvm_unreachable (" Covered switch isn't covered?!" );
661
684
}
662
685
663
- // / If this is a terminator apply site, then pass a builder to insert at the
664
- // / first instruction of each successor to \p func. Otherwise, pass a builder
665
- // / to insert at std::next(Inst).
666
- // /
667
- // / The intention is that this abstraction will enable the compiler writer to
668
- // / ignore whether or not an apply site is a terminator when inserting
669
- // / instructions after an apply site. This results in eliminating unnecessary
670
- // / if-else code otherwise required to handle such situations.
671
- // /
672
- // / NOTE: We pass std::next() for begin_apply. If one wishes to insert code
673
- // / /after/ the end_apply/abort_apply, please use instead
674
- // / insertAfterFullEvaluation.
675
- void insertAfterInvocation (function_ref<void (SILBuilder &)> func) const ;
676
-
677
- // / Pass a builder with insertion points that are guaranteed to be immediately
678
- // / after this full apply site has completely finished executing.
679
- // /
680
- // / This is just like insertAfterInvocation except that if the full apply site
681
- // / is a begin_apply, we pass the insertion points after the end_apply,
682
- // / abort_apply rather than an insertion point right after the
683
- // / begin_apply. For such functionality, please invoke insertAfterInvocation.
684
- void insertAfterFullEvaluation (function_ref<void (SILBuilder &)> func) const ;
685
-
686
686
// / Returns true if \p op is an operand that passes an indirect
687
687
// / result argument to the apply site.
688
688
bool isIndirectResultOperand (const Operand &op) const {
0 commit comments