[PATCH] D15776: Filtering IR printing for print-after-all/print-before-all
Mehdi AMINI via llvm-commits
llvm-commits at lists.llvm.org
Tue Jan 5 16:17:05 PST 2016
joker.eph added inline comments.
================
Comment at: lib/IR/LegacyPassManager.cpp:129
@@ -112,2 +128,3 @@
+}
/// isPassDebuggingExecutionsOrMore - Return true if -debug-pass=Executions
/// or higher is specified.
----------------
joker.eph wrote:
> weimingz wrote:
> > Module printing is different. It not just prints each functions but also others like meta, GV, triple, etc. By default (not specify anything on the filter list), it should print all those stuff.
> >
> > So we need two functionalities: 1) tell if some function is in list or not; 2) tell if we specified anything to the list.
> You don't need to add `"*"` to the set to have the empty case working since in the empty case true is returned for anything.
To be more clear, I don't see why this wouldn't work:
```
bool llvm::isFunctionInPrintList(StringRef FunctionName) {
static std::unordered_set<std::string> PrintFuncNames(PrintFuncsList.begin(),
PrintFuncsList.end());
if (PrintFuncNames.empty())
return true;
return PrintFuncNames.count(FunctionName);
}
```
Repository:
rL LLVM
http://reviews.llvm.org/D15776
More information about the llvm-commits
mailing list