Skip to content

Commit 38b2660

Browse files
committed
Expose the LowerHopToActorPass as API so LLDB can schedule it
rdar://75905336
1 parent a4e71aa commit 38b2660

File tree

4 files changed

+23
-1
lines changed

4 files changed

+23
-1
lines changed

include/swift/SILOptimizer/PassManager/PassPipeline.def

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
#endif
2424

2525
PASSPIPELINE(Diagnostic, "Guaranteed Passes")
26+
PASSPIPELINE(LowerHopToActor, "Lower Hop to Actor")
2627
PASSPIPELINE(OwnershipEliminator, "Utility pass to just run the ownership eliminator pass")
2728
PASSPIPELINE(Performance, "Passes run at -O")
2829
PASSPIPELINE(Onone, "Passes run at -Onone")

include/swift/SILOptimizer/PassManager/Passes.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,10 @@ namespace swift {
3939
/// Run all SIL passes for -Onone on module \p M.
4040
void runSILPassesForOnone(SILModule &M);
4141

42-
/// Run the SIL ownership eliminator pass on \p M.
42+
/// Run the SIL lower hop-to-actor pass on \p M.
43+
bool runSILLowerHopToActorPass(SILModule &M);
44+
45+
/// Run the SIL ownership eliminator pass on \p M.
4346
bool runSILOwnershipEliminatorPass(SILModule &M);
4447

4548
void runSILOptimizationPassesWithFileSpecification(SILModule &Module,

lib/SILOptimizer/PassManager/PassPipeline.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,14 @@ SILPassPipelinePlan::getDiagnosticPassPipeline(const SILOptions &Options) {
185185
return P;
186186
}
187187

188+
SILPassPipelinePlan SILPassPipelinePlan::getLowerHopToActorPassPipeline(
189+
const SILOptions &Options) {
190+
SILPassPipelinePlan P(Options);
191+
P.startPipeline("Lower Hop to Actor");
192+
P.addLowerHopToActor();
193+
return P;
194+
}
195+
188196
//===----------------------------------------------------------------------===//
189197
// Ownership Eliminator Pipeline
190198
//===----------------------------------------------------------------------===//

lib/SILOptimizer/PassManager/Passes.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,16 @@ bool swift::runSILDiagnosticPasses(SILModule &Module) {
7474
return Ctx.hadError();
7575
}
7676

77+
bool swift::runSILLowerHopToActorPass(SILModule &Module) {
78+
auto &Ctx = Module.getASTContext();
79+
80+
auto &opts = Module.getOptions();
81+
executePassPipelinePlan(
82+
&Module, SILPassPipelinePlan::getLowerHopToActorPassPipeline(opts));
83+
84+
return Ctx.hadError();
85+
}
86+
7787
bool swift::runSILOwnershipEliminatorPass(SILModule &Module) {
7888
auto &Ctx = Module.getASTContext();
7989

0 commit comments

Comments
 (0)