@@ -58,8 +58,8 @@ llvm::cl::opt<std::string> SILBreakOnPass(
58
58
" sil-break-on-pass" , llvm::cl::init(" " ),
59
59
llvm::cl::desc(" Break before running a particular function pass" ));
60
60
61
- llvm::cl::opt <std::string>
62
- SILPrintOnlyFun (" sil-print-only-function" , llvm::cl::init( " " ) ,
61
+ llvm::cl::list <std::string>
62
+ SILPrintOnlyFun (" sil-print-only-function" , llvm::cl::CommaSeparated ,
63
63
llvm::cl::desc (" Only print out the sil for this function" ));
64
64
65
65
llvm::cl::opt<std::string>
@@ -144,7 +144,8 @@ static llvm::cl::opt<DebugOnlyPassNumberOpt, true,
144
144
llvm::cl::ValueRequired);
145
145
146
146
static bool doPrintBefore (SILTransform *T, SILFunction *F) {
147
- if (!SILPrintOnlyFun.empty () && F && F->getName () != SILPrintOnlyFun)
147
+ if (!SILPrintOnlyFun.empty () && F && SILPrintOnlyFun.end () ==
148
+ std::find (SILPrintOnlyFun.begin (), SILPrintOnlyFun.end (), F->getName ()))
148
149
return false ;
149
150
150
151
if (!SILPrintOnlyFuns.empty () && F &&
@@ -168,7 +169,8 @@ static bool doPrintBefore(SILTransform *T, SILFunction *F) {
168
169
}
169
170
170
171
static bool doPrintAfter (SILTransform *T, SILFunction *F, bool Default) {
171
- if (!SILPrintOnlyFun.empty () && F && F->getName () != SILPrintOnlyFun)
172
+ if (!SILPrintOnlyFun.empty () && F && SILPrintOnlyFun.end () ==
173
+ std::find (SILPrintOnlyFun.begin (), SILPrintOnlyFun.end (), F->getName ()))
172
174
return false ;
173
175
174
176
if (!SILPrintOnlyFuns.empty () && F &&
@@ -207,7 +209,8 @@ static void printModule(SILModule *Mod, bool EmitVerboseSIL) {
207
209
return ;
208
210
}
209
211
for (auto &F : *Mod) {
210
- if (!SILPrintOnlyFun.empty () && F.getName ().str () == SILPrintOnlyFun)
212
+ if (!SILPrintOnlyFun.empty () && SILPrintOnlyFun.end () !=
213
+ std::find (SILPrintOnlyFun.begin (), SILPrintOnlyFun.end (), F.getName ()))
211
214
F.dump (EmitVerboseSIL);
212
215
213
216
if (!SILPrintOnlyFuns.empty () &&
0 commit comments