Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions lib/SILOptimizer/PassManager/PassPipeline.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,14 @@ static llvm::cl::opt<bool> SILViewSILGenCFG(
"sil-view-silgen-cfg", llvm::cl::init(false),
llvm::cl::desc("Enable the sil cfg viewer pass before diagnostics"));

static llvm::cl::opt<bool> SILPrintSILGenModule(
"sil-print-silgen-module", llvm::cl::init(false),
llvm::cl::desc("Enable printing the module after SILGen"));

static llvm::cl::opt<bool> SILPrintFinalModule(
"sil-print-final-module", llvm::cl::init(false),
llvm::cl::desc("Enable printing the module after all SIL passes"));

//===----------------------------------------------------------------------===//
// Diagnostic Pass Pipeline
//===----------------------------------------------------------------------===//
Expand Down Expand Up @@ -283,6 +291,9 @@ SILPassPipelinePlan::getSILGenPassPipeline(const SILOptions &Options) {
if (SILViewSILGenCFG) {
addCFGPrinterPipeline(P, "SIL View SILGen CFG");
}
if (SILPrintSILGenModule) {
addModulePrinterPipeline(P, "SIL Print SILGen Module");
}
return P;
}

Expand Down Expand Up @@ -1044,6 +1055,9 @@ SILPassPipelinePlan::getPerformancePassPipeline(const SILOptions &Options) {
if (SILViewCFG) {
addCFGPrinterPipeline(P, "SIL Before IRGen View CFG");
}
if (SILPrintFinalModule) {
addModulePrinterPipeline(P, "SIL Print Final Module");
}

return P;
}
Expand Down Expand Up @@ -1127,6 +1141,9 @@ SILPassPipelinePlan::getOnonePassPipeline(const SILOptions &Options) {
// Has only an effect if the -sil-based-debuginfo option is specified.
P.addSILDebugInfoGenerator();

if (SILPrintFinalModule) {
addModulePrinterPipeline(P, "SIL Print Final Module");
}
return P;
}

Expand Down