[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
This commit is contained in:
Chandler Carruth 2017-01-22 10:33:54 +00:00
parent eb3067ee85
commit aa6b187ab1
1 changed files with 4 additions and 3 deletions

View File

@ -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);
}