@@ -52,6 +52,10 @@ static llvm::cl::opt<bool> SILPrintCanonicalModule(
52
52
" sil-print-canonical-module" , llvm::cl::init(false ),
53
53
llvm::cl::desc(" Print the textual SIL module after diagnostics" ));
54
54
55
+ static llvm::cl::opt<bool > SILPrintFinalOSSAModule (
56
+ " sil-print-final-ossa-module" , llvm::cl::init(false ),
57
+ llvm::cl::desc(" Print the textual SIL module before lowering from OSSA" ));
58
+
55
59
static llvm::cl::opt<bool > SILViewSILGenCFG (
56
60
" sil-view-silgen-cfg" , llvm::cl::init(false ),
57
61
llvm::cl::desc(" Enable the sil cfg viewer pass before diagnostics" ));
@@ -549,6 +553,9 @@ static void addPerfEarlyModulePassPipeline(SILPassPipelinePlan &P) {
549
553
if (P.getOptions ().StopOptimizationBeforeLoweringOwnership )
550
554
return ;
551
555
556
+ if (SILPrintFinalOSSAModule) {
557
+ addModulePrinterPipeline (P, " SIL Print Final OSSA Module" );
558
+ }
552
559
P.addNonTransparentFunctionOwnershipModelEliminator ();
553
560
}
554
561
@@ -568,6 +575,9 @@ static void addPerfEarlyModulePassPipeline(SILPassPipelinePlan &P) {
568
575
if (P.getOptions ().StopOptimizationBeforeLoweringOwnership )
569
576
return ;
570
577
578
+ if (SILPrintFinalOSSAModule) {
579
+ addModulePrinterPipeline (P, " SIL Print Final OSSA Module" );
580
+ }
571
581
P.addNonTransparentFunctionOwnershipModelEliminator ();
572
582
}
573
583
0 commit comments