From aa6b187ab1ed7b7fc976ccf5711d54f9fe20a7a1 Mon Sep 17 00:00:00 2001 From: Chandler Carruth Date: Sun, 22 Jan 2017 10:33:54 +0000 Subject: [PATCH] [PM] Improve the debug logging to always include the IR unit's name when logging pass and analyses information. This is particularly useful when filtering the debug log for a particular function or loop where something got inappropriately cached. llvm-svn: 292755 --- llvm/include/llvm/IR/PassManager.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/llvm/include/llvm/IR/PassManager.h b/llvm/include/llvm/IR/PassManager.h index 0825ed713ac1..61b6278ea0b9 100644 --- a/llvm/include/llvm/IR/PassManager.h +++ b/llvm/include/llvm/IR/PassManager.h @@ -791,7 +791,7 @@ public: if (DebugLogging) dbgs() << "Invalidating analysis: " << this->lookUpPass(ID).name() - << "\n"; + << " on " << IR.getName() << "\n"; I = ResultsList.erase(I); AnalysisResults.erase({ID, &IR}); @@ -832,7 +832,8 @@ private: if (Inserted) { auto &P = this->lookUpPass(ID); if (DebugLogging) - dbgs() << "Running analysis: " << P.name() << "\n"; + dbgs() << "Running analysis: " << P.name() << " on " << IR.getName() + << "\n"; AnalysisResultListT &ResultList = AnalysisResultLists[&IR]; ResultList.emplace_back(ID, P.run(IR, *this, ExtraArgs...)); @@ -863,7 +864,7 @@ private: if (DebugLogging) dbgs() << "Invalidating analysis: " << this->lookUpPass(ID).name() - << "\n"; + << " on " << IR.getName() << "\n"; AnalysisResultLists[&IR].erase(RI->second); AnalysisResults.erase(RI); }