[llvm-commits] CVS: llvm/lib/Transforms/Instrumentation/BlockProfiling.cpp EdgeProfiling.cpp RSProfiling.cpp TraceBasicBlocks.cpp

Bill Wendling isanbard at gmail.com
Sun Nov 26 01:17:26 PST 2006



Changes in directory llvm/lib/Transforms/Instrumentation:

BlockProfiling.cpp updated: 1.16 -> 1.17
EdgeProfiling.cpp updated: 1.7 -> 1.8
RSProfiling.cpp updated: 1.9 -> 1.10
TraceBasicBlocks.cpp updated: 1.17 -> 1.18
---
Log message:

Removed #include <iostream> and used the llvm_cerr/DOUT streams instead.


---
Diffs of the changes:  (+9 -14)

 BlockProfiling.cpp   |    7 +++----
 EdgeProfiling.cpp    |    4 ++--
 RSProfiling.cpp      |    5 +----
 TraceBasicBlocks.cpp |    7 +++----
 4 files changed, 9 insertions(+), 14 deletions(-)


Index: llvm/lib/Transforms/Instrumentation/BlockProfiling.cpp
diff -u llvm/lib/Transforms/Instrumentation/BlockProfiling.cpp:1.16 llvm/lib/Transforms/Instrumentation/BlockProfiling.cpp:1.17
--- llvm/lib/Transforms/Instrumentation/BlockProfiling.cpp:1.16	Sun Aug 27 19:42:29 2006
+++ llvm/lib/Transforms/Instrumentation/BlockProfiling.cpp	Sun Nov 26 03:17:06 2006
@@ -23,11 +23,10 @@
 #include "llvm/DerivedTypes.h"
 #include "llvm/Module.h"
 #include "llvm/Pass.h"
+#include "llvm/Support/Streams.h"
 #include "llvm/Transforms/Instrumentation.h"
 #include "RSProfiling.h"
 #include "ProfilingUtils.h"
-#include <iostream>
-
 using namespace llvm;
 
 namespace {
@@ -48,7 +47,7 @@
 bool FunctionProfiler::runOnModule(Module &M) {
   Function *Main = M.getMainFunction();
   if (Main == 0) {
-    std::cerr << "WARNING: cannot insert function profiling into a module"
+    llvm_cerr << "WARNING: cannot insert function profiling into a module"
               << " with no main function!\n";
     return false;  // No main, no instrumentation!
   }
@@ -91,7 +90,7 @@
 bool BlockProfiler::runOnModule(Module &M) {
   Function *Main = M.getMainFunction();
   if (Main == 0) {
-    std::cerr << "WARNING: cannot insert block profiling into a module"
+    llvm_cerr << "WARNING: cannot insert block profiling into a module"
               << " with no main function!\n";
     return false;  // No main, no instrumentation!
   }


Index: llvm/lib/Transforms/Instrumentation/EdgeProfiling.cpp
diff -u llvm/lib/Transforms/Instrumentation/EdgeProfiling.cpp:1.7 llvm/lib/Transforms/Instrumentation/EdgeProfiling.cpp:1.8
--- llvm/lib/Transforms/Instrumentation/EdgeProfiling.cpp:1.7	Sun Aug 27 17:42:52 2006
+++ llvm/lib/Transforms/Instrumentation/EdgeProfiling.cpp	Sun Nov 26 03:17:06 2006
@@ -21,10 +21,10 @@
 #include "llvm/DerivedTypes.h"
 #include "llvm/Module.h"
 #include "llvm/Pass.h"
+#include "llvm/Support/Streams.h"
 #include "llvm/Transforms/Utils/BasicBlockUtils.h"
 #include "llvm/Transforms/Instrumentation.h"
 #include "ProfilingUtils.h"
-#include <iostream>
 #include <set>
 using namespace llvm;
 
@@ -42,7 +42,7 @@
 bool EdgeProfiler::runOnModule(Module &M) {
   Function *Main = M.getMainFunction();
   if (Main == 0) {
-    std::cerr << "WARNING: cannot insert edge profiling into a module"
+    llvm_cerr << "WARNING: cannot insert edge profiling into a module"
               << " with no main function!\n";
     return false;  // No main, no instrumentation!
   }


Index: llvm/lib/Transforms/Instrumentation/RSProfiling.cpp
diff -u llvm/lib/Transforms/Instrumentation/RSProfiling.cpp:1.9 llvm/lib/Transforms/Instrumentation/RSProfiling.cpp:1.10
--- llvm/lib/Transforms/Instrumentation/RSProfiling.cpp:1.9	Thu Nov  2 14:25:50 2006
+++ llvm/lib/Transforms/Instrumentation/RSProfiling.cpp	Sun Nov 26 03:17:06 2006
@@ -45,13 +45,10 @@
 #include "llvm/Transforms/Instrumentation.h"
 //#include "ProfilingUtils.h"
 #include "RSProfiling.h"
-
 #include <set>
 #include <map>
 #include <queue>
 #include <list>
-#include <iostream>
-
 using namespace llvm;
 
 namespace {
@@ -628,7 +625,7 @@
   std::map<BasicBlock*, int> finish;
   int time = 0;
   recBackEdge(&F.getEntryBlock(), BackEdges, color, depth, finish, time);
-  DEBUG(std::cerr << F.getName() << " " << BackEdges.size() << "\n");
+  DOUT << F.getName() << " " << BackEdges.size() << "\n";
 }
 
 


Index: llvm/lib/Transforms/Instrumentation/TraceBasicBlocks.cpp
diff -u llvm/lib/Transforms/Instrumentation/TraceBasicBlocks.cpp:1.17 llvm/lib/Transforms/Instrumentation/TraceBasicBlocks.cpp:1.18
--- llvm/lib/Transforms/Instrumentation/TraceBasicBlocks.cpp:1.17	Thu Nov  2 14:25:50 2006
+++ llvm/lib/Transforms/Instrumentation/TraceBasicBlocks.cpp	Sun Nov 26 03:17:06 2006
@@ -23,7 +23,6 @@
 #include "ProfilingUtils.h"
 #include "llvm/Support/Debug.h"
 #include <set>
-#include <iostream>
 using namespace llvm;
 
 namespace {
@@ -43,8 +42,8 @@
 static void InsertInstrumentationCall (BasicBlock *BB,
                                        const std::string FnName,
                                        unsigned BBNumber) {
-  DEBUG (std::cerr << "InsertInstrumentationCall (\"" << BB->getName ()
-                   << "\", \"" << FnName << "\", " << BBNumber << ")\n");
+  DOUT << "InsertInstrumentationCall (\"" << BB->getName ()
+       << "\", \"" << FnName << "\", " << BBNumber << ")\n";
   Module &M = *BB->getParent ()->getParent ();
   Function *InstrFn = M.getOrInsertFunction (FnName, Type::VoidTy,
                                              Type::UIntTy, (Type *)0);
@@ -62,7 +61,7 @@
 bool TraceBasicBlocks::runOnModule(Module &M) {
   Function *Main = M.getMainFunction();
   if (Main == 0) {
-    std::cerr << "WARNING: cannot insert basic-block trace instrumentation"
+    llvm_cerr << "WARNING: cannot insert basic-block trace instrumentation"
               << " into a module with no main function!\n";
     return false;  // No main, no instrumentation!
   }






More information about the llvm-commits mailing list