]> granicus.if.org Git - llvm/commitdiff
[PM] Improve the debug logging to always include the IR unit's name when
authorChandler Carruth <chandlerc@gmail.com>
Sun, 22 Jan 2017 10:33:54 +0000 (10:33 +0000)
committerChandler Carruth <chandlerc@gmail.com>
Sun, 22 Jan 2017 10:33:54 +0000 (10:33 +0000)
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292755 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/IR/PassManager.h

index 0825ed713ac17283db4c8cb35b8525d319a874fd..61b6278ea0b96db824fb2a4912fdffeef12be0d6 100644 (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);
   }