diff options
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/Analysis/CallGraphSCCPass.cpp | 7 | ||||
-rw-r--r-- | llvm/lib/Analysis/LoopPass.cpp | 6 | ||||
-rw-r--r-- | llvm/lib/CodeGen/MachineFunctionPrinterPass.cpp | 4 | ||||
-rw-r--r-- | llvm/lib/IR/IRPrintingPasses.cpp | 13 | ||||
-rw-r--r-- | llvm/lib/IR/LegacyPassManager.cpp | 13 |
5 files changed, 8 insertions, 35 deletions
diff --git a/llvm/lib/Analysis/CallGraphSCCPass.cpp b/llvm/lib/Analysis/CallGraphSCCPass.cpp index 6dd1d0a066b..07b389a2a13 100644 --- a/llvm/lib/Analysis/CallGraphSCCPass.cpp +++ b/llvm/lib/Analysis/CallGraphSCCPass.cpp @@ -612,10 +612,9 @@ namespace { bool runOnSCC(CallGraphSCC &SCC) override { Out << Banner; for (CallGraphNode *CGN : SCC) { - if (CGN->getFunction()) { - if (isFunctionInPrintList(CGN->getFunction()->getName())) - CGN->getFunction()->print(Out); - } else + if (CGN->getFunction()) + CGN->getFunction()->print(Out); + else Out << "\nPrinting <null> Function\n"; } return false; diff --git a/llvm/lib/Analysis/LoopPass.cpp b/llvm/lib/Analysis/LoopPass.cpp index e24a9e46fc1..dc424734dd5 100644 --- a/llvm/lib/Analysis/LoopPass.cpp +++ b/llvm/lib/Analysis/LoopPass.cpp @@ -42,11 +42,7 @@ public: } bool runOnLoop(Loop *L, LPPassManager &) override { - auto BBI = find_if(L->blocks().begin(), L->blocks().end(), - [](BasicBlock *BB) { return BB; }); - if (BBI != L->blocks().end() && - isFunctionInPrintList((*BBI)->getParent()->getName())) - P.run(*L); + P.run(*L); return false; } }; diff --git a/llvm/lib/CodeGen/MachineFunctionPrinterPass.cpp b/llvm/lib/CodeGen/MachineFunctionPrinterPass.cpp index 4f424ff292c..790f5accdb2 100644 --- a/llvm/lib/CodeGen/MachineFunctionPrinterPass.cpp +++ b/llvm/lib/CodeGen/MachineFunctionPrinterPass.cpp @@ -31,7 +31,7 @@ struct MachineFunctionPrinterPass : public MachineFunctionPass { const std::string Banner; MachineFunctionPrinterPass() : MachineFunctionPass(ID), OS(dbgs()) { } - MachineFunctionPrinterPass(raw_ostream &os, const std::string &banner) + MachineFunctionPrinterPass(raw_ostream &os, const std::string &banner) : MachineFunctionPass(ID), OS(os), Banner(banner) {} const char *getPassName() const override { return "MachineFunction Printer"; } @@ -42,8 +42,6 @@ struct MachineFunctionPrinterPass : public MachineFunctionPass { } bool runOnMachineFunction(MachineFunction &MF) override { - if (!llvm::isFunctionInPrintList(MF.getName())) - return false; OS << "# " << Banner << ":\n"; MF.print(OS, getAnalysisIfAvailable<SlotIndexes>()); return false; diff --git a/llvm/lib/IR/IRPrintingPasses.cpp b/llvm/lib/IR/IRPrintingPasses.cpp index c23f44a955e..c1ac336c1fb 100644 --- a/llvm/lib/IR/IRPrintingPasses.cpp +++ b/llvm/lib/IR/IRPrintingPasses.cpp @@ -27,14 +27,8 @@ PrintModulePass::PrintModulePass(raw_ostream &OS, const std::string &Banner, ShouldPreserveUseListOrder(ShouldPreserveUseListOrder) {} PreservedAnalyses PrintModulePass::run(Module &M) { - OS << Banner << "\n"; - if (llvm::isFunctionInPrintList("*")) - M.print(OS, nullptr, ShouldPreserveUseListOrder); - else { - for(const auto &F : M.functions()) - if (llvm::isFunctionInPrintList(F.getName())) - F.print(OS); - } + OS << Banner; + M.print(OS, nullptr, ShouldPreserveUseListOrder); return PreservedAnalyses::all(); } @@ -43,8 +37,7 @@ PrintFunctionPass::PrintFunctionPass(raw_ostream &OS, const std::string &Banner) : OS(OS), Banner(Banner) {} PreservedAnalyses PrintFunctionPass::run(Function &F) { - if (isFunctionInPrintList(F.getName())) - OS << Banner << static_cast<Value &>(F); + OS << Banner << static_cast<Value &>(F); return PreservedAnalyses::all(); } diff --git a/llvm/lib/IR/LegacyPassManager.cpp b/llvm/lib/IR/LegacyPassManager.cpp index 63d89f21b35..f2e0c7d32c0 100644 --- a/llvm/lib/IR/LegacyPassManager.cpp +++ b/llvm/lib/IR/LegacyPassManager.cpp @@ -28,7 +28,6 @@ #include "llvm/Support/raw_ostream.h" #include <algorithm> #include <map> -#include <unordered_set> using namespace llvm; using namespace llvm::legacy; @@ -84,13 +83,6 @@ PrintAfterAll("print-after-all", llvm::cl::desc("Print IR after each pass"), cl::init(false)); -static cl::list<std::string> - PrintFuncsList("filter-print-funcs", cl::value_desc("function names"), - cl::desc("Only print IR for functions whose name " - "match this for all print-[before|after][-all] " - "options"), - cl::CommaSeparated); - /// This is a helper to determine whether to print IR before or /// after a pass. @@ -117,11 +109,6 @@ static bool ShouldPrintAfterPass(const PassInfo *PI) { return PrintAfterAll || ShouldPrintBeforeOrAfterPass(PI, PrintAfter); } -bool llvm::isFunctionInPrintList(StringRef FunctionName) { - static std::unordered_set<std::string> PrintFuncNames(PrintFuncsList.begin(), - PrintFuncsList.end()); - return PrintFuncNames.empty() || PrintFuncNames.count(FunctionName); -} /// isPassDebuggingExecutionsOrMore - Return true if -debug-pass=Executions /// or higher is specified. bool PMDataManager::isPassDebuggingExecutionsOrMore() const { |