Move some warnings to debug mode.
authorAndrew Lenharth <andrewl@lenharth.org>
Fri, 13 Oct 2006 17:38:22 +0000 (17:38 +0000)
committerAndrew Lenharth <andrewl@lenharth.org>
Fri, 13 Oct 2006 17:38:22 +0000 (17:38 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30933 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Analysis/DataStructure/BottomUpClosure.cpp
lib/Analysis/DataStructure/CompleteBottomUp.cpp
lib/Analysis/DataStructure/Local.cpp
lib/Analysis/DataStructure/TopDownClosure.cpp

index d2708b0fb1cb1c5f9e346ee2755d90734e0d0eb7..1a69e172a67d4f386f4a893f01fbe131c630d332 100644 (file)
@@ -171,11 +171,9 @@ bool BUDataStructures::runOnModule(Module &M) {
   // Calculate the graphs for any functions that are unreachable from main...
   for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I)
     if (!I->isExternal() && !DSInfo.count(I)) {
-#ifndef NDEBUG
       if (MainFunc)
-        std::cerr << "*** BU: Function unreachable from main: "
-                  << I->getName() << "\n";
-#endif
+        DEBUG(std::cerr << "*** BU: Function unreachable from main: "
+              << I->getName() << "\n");
       calculateGraphs(I, Stack, NextID, ValMap);     // Calculate all graphs.
     }
 
@@ -206,7 +204,7 @@ bool BUDataStructures::runOnModule(Module &M) {
   BuildGlobalECs(*GlobalsGraph, ECGlobals);
   if (!ECGlobals.empty()) {
     NamedRegionTimer X("Bottom-UP EC Cleanup");
-    std::cerr << "Eliminating " << ECGlobals.size() << " EC Globals!\n";
+    DEBUG(std::cerr << "Eliminating " << ECGlobals.size() << " EC Globals!\n");
     for (hash_map<Function*, DSGraph*>::iterator I = DSInfo.begin(),
            E = DSInfo.end(); I != E; ++I)
       EliminateUsesOfECGlobals(*I->second, ECGlobals);
@@ -237,11 +235,12 @@ bool BUDataStructures::runOnModule(Module &M) {
          ee = MainGraph.afc_end(); ii != ee; ++ii) {
       std::vector<Function*> Funcs;
       GetAllCallees(*ii, Funcs);
-      std::cerr << "Lost site\n";
+      DEBUG(std::cerr << "Lost site\n");
+      DEBUG(ii->getCallSite().getInstruction()->dump());
       for (std::vector<Function*>::iterator iif = Funcs.begin(), eef = Funcs.end();
           iif != eef; ++iif) {
        AddGlobalToNode(this, *ii, *iif);
-       std::cerr << "Adding\n";
+       DEBUG(std::cerr << "Adding\n");
        ActualCallees.insert(std::make_pair(ii->getCallSite().getInstruction(), *iif));
       }
     }
@@ -421,8 +420,8 @@ unsigned BUDataStructures::calculateGraphs(Function *F,
     }
     Stack.pop_back();
 
-    std::cerr << "Calculating graph for SCC #: " << MyID << " of size: "
-              << SCCSize << "\n";
+    DEBUG(std::cerr << "Calculating graph for SCC #: " << MyID << " of size: "
+          << SCCSize << "\n");
 
     // Compute the Max SCC Size.
     if (MaxSCC < SCCSize)
@@ -441,7 +440,7 @@ unsigned BUDataStructures::calculateGraphs(Function *F,
       DEBUG(std::cerr << "MISSING REDO\n");
     }
 
-    std::cerr << "DONE with SCC #: " << MyID << "\n";
+    DEBUG(std::cerr << "DONE with SCC #: " << MyID << "\n");
 
     // We never have to revisit "SCC" processed functions...
     return MyID;
index ea21a4f03051519ae577328dcf15fa83f13745a8..90c14b408ff59f29dcd020d66f60f4ec53e5ee60 100644 (file)
@@ -52,16 +52,15 @@ bool CompleteBUDataStructures::runOnModule(Module &M) {
     if (!MainFunc->isExternal())
       calculateSCCGraphs(getOrCreateGraph(*MainFunc), Stack, NextID, ValMap);
   } else {
-    std::cerr << "CBU-DSA: No 'main' function found!\n";
+    DEBUG(std::cerr << "CBU-DSA: No 'main' function found!\n");
   }
 
   for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I)
     if (!I->isExternal() && !DSInfo.count(I)) {
-#ifndef NDEBUG
-      if (MainFunc)
-        std::cerr << "*** CBU: Function unreachable from main: "
-                  << I->getName() << "\n";
-#endif
+      if (MainFunc) {
+        DEBUG(std::cerr << "*** CBU: Function unreachable from main: "
+              << I->getName() << "\n");
+      }
       calculateSCCGraphs(getOrCreateGraph(*I), Stack, NextID, ValMap);
     }
 
index c70970ac31d91e54b57a12c64c98a56c51032ce1..dbfbea3981d9e961327fbf244db8fdb3645635b9 100644 (file)
@@ -544,6 +544,9 @@ void GraphBuilder::visitCallSite(CallSite CS) {
           mergeWith(getValueDest(**(CS.arg_begin())));
         return;
       case Intrinsic::vaend:
+      case Intrinsic::dbg_func_start:
+      case Intrinsic::dbg_region_end:
+      case Intrinsic::dbg_stoppoint:
         return;  // noop
       case Intrinsic::memcpy_i32: 
       case Intrinsic::memcpy_i64:
@@ -1028,9 +1031,10 @@ void GraphBuilder::visitCallSite(CallSite CS) {
                 Warn = true;
                 break;
               }
-          if (Warn)
-            std::cerr << "WARNING: Call to unknown external function '"
-                      << F->getName() << "' will cause pessimistic results!\n";
+          if (Warn) {
+            DEBUG(std::cerr << "WARNING: Call to unknown external function '"
+                  << F->getName() << "' will cause pessimistic results!\n");
+          }
         }
       }
 
index 9fdaac3c348b4b4b9e51b4e7a51b0fef3f98f1a8..55a37dbcd164ea3409d42c97b675fef7b979aa52 100644 (file)
@@ -371,8 +371,8 @@ void TDDataStructures::InlineCallersIntoGraph(DSGraph &DSG) {
 
     // If we already have this graph, recycle it.
     if (IndCallRecI != IndCallMap.end() && IndCallRecI->first == Callees) {
-      std::cerr << "  [TD] *** Reuse of indcall graph for " << Callees.size()
-                << " callees!\n";
+      DEBUG(std::cerr << "  [TD] *** Reuse of indcall graph for " << Callees.size()
+            << " callees!\n");
       IndCallGraph = IndCallRecI->second;
     } else {
       // Otherwise, create a new DSGraph to represent this.