Skip to content

Commit

Permalink
Merge pull request #25 from apple/master
Browse files Browse the repository at this point in the history
[pull] swiftwasm from apple:master
  • Loading branch information
pull[bot] authored Jan 26, 2020
2 parents 78d14f9 + ef7ddda commit f33b187
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions lib/SILOptimizer/PassManager/PassManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ llvm::cl::opt<std::string> SILBreakOnPass(
"sil-break-on-pass", llvm::cl::init(""),
llvm::cl::desc("Break before running a particular function pass"));

llvm::cl::opt<std::string>
SILPrintOnlyFun("sil-print-only-function", llvm::cl::init(""),
llvm::cl::list<std::string>
SILPrintOnlyFun("sil-print-only-function", llvm::cl::CommaSeparated,
llvm::cl::desc("Only print out the sil for this function"));

llvm::cl::opt<std::string>
Expand Down Expand Up @@ -144,7 +144,8 @@ static llvm::cl::opt<DebugOnlyPassNumberOpt, true,
llvm::cl::ValueRequired);

static bool doPrintBefore(SILTransform *T, SILFunction *F) {
if (!SILPrintOnlyFun.empty() && F && F->getName() != SILPrintOnlyFun)
if (!SILPrintOnlyFun.empty() && F && SILPrintOnlyFun.end() ==
std::find(SILPrintOnlyFun.begin(), SILPrintOnlyFun.end(), F->getName()))
return false;

if (!SILPrintOnlyFuns.empty() && F &&
Expand All @@ -168,7 +169,8 @@ static bool doPrintBefore(SILTransform *T, SILFunction *F) {
}

static bool doPrintAfter(SILTransform *T, SILFunction *F, bool Default) {
if (!SILPrintOnlyFun.empty() && F && F->getName() != SILPrintOnlyFun)
if (!SILPrintOnlyFun.empty() && F && SILPrintOnlyFun.end() ==
std::find(SILPrintOnlyFun.begin(), SILPrintOnlyFun.end(), F->getName()))
return false;

if (!SILPrintOnlyFuns.empty() && F &&
Expand Down Expand Up @@ -207,7 +209,8 @@ static void printModule(SILModule *Mod, bool EmitVerboseSIL) {
return;
}
for (auto &F : *Mod) {
if (!SILPrintOnlyFun.empty() && F.getName().str() == SILPrintOnlyFun)
if (!SILPrintOnlyFun.empty() && SILPrintOnlyFun.end() !=
std::find(SILPrintOnlyFun.begin(), SILPrintOnlyFun.end(), F.getName()))
F.dump(EmitVerboseSIL);

if (!SILPrintOnlyFuns.empty() &&
Expand Down

0 comments on commit f33b187

Please sign in to comment.