[llvm-commits] CVS: reopt/lib/TraceToFunction/TraceToFunction.cpp

Brian Gaeke gaeke at cs.uiuc.edu
Thu May 20 15:39:01 PDT 2004


Changes in directory reopt/lib/TraceToFunction:

TraceToFunction.cpp updated: 1.51 -> 1.52

---
Log message:

Make cloneMapDump() into a method that is easier to call from the debugger.
Don't call it by default, because it takes a long time on big modules.


---
Diffs of the changes:  (+12 -11)

Index: reopt/lib/TraceToFunction/TraceToFunction.cpp
diff -u reopt/lib/TraceToFunction/TraceToFunction.cpp:1.51 reopt/lib/TraceToFunction/TraceToFunction.cpp:1.52
--- reopt/lib/TraceToFunction/TraceToFunction.cpp:1.51	Thu May 20 15:04:27 2004
+++ reopt/lib/TraceToFunction/TraceToFunction.cpp	Thu May 20 15:38:04 2004
@@ -66,6 +66,8 @@
   void fixupFunctionBodyBB (Trace &T, Function *F, BasicBlock *srcB,
 				            BasicBlock *dstB, ValueMap &O2CMap,
 				            LiveVariableSet &So);
+
+  void cloneMapDump ();
 public:
   TraceFunctionBuilder () { }
   virtual ~TraceFunctionBuilder () { }
@@ -668,20 +670,21 @@
 }
 
 /// Dump out the O2CMap for the given TraceFunction to stderr.
-/// Only called when debugging.
+/// You can call this from the debugger if you want to see the gory details,
+/// because it takes a really long time on big modules.
 ///
-static void cloneMapDump (TraceFunction *TF, std::ostream &OS) {
-  OS << "\n; TraceFunctionBuilder Original-->Clone map follows:\n";
+void TraceFunctionBuilder::cloneMapDump () {
+  std::cerr << "\n; TraceFunctionBuilder Original-->Clone map follows:\n";
   for (ValueMap::const_iterator i = TF->O2CMap.begin(), e = TF->O2CMap.end();
        i != e; ++i) {
     const std::pair<const Value *, Value *> &elem = *i;
-    OS << "(original-value \"";
-    WriteAsOperand (OS, i->first, true, true, TF->MatrixFn->getParent ());
-    OS << "\" maps-to \"";
-    WriteAsOperand (OS, i->second, true, true, TF->TraceFn->getParent ());
-    OS << "\")\n";
+    std::cerr << "(original-value \"";
+    WriteAsOperand (std::cerr, i->first, true, true, TF->MatrixFn->getParent ());
+    std::cerr << "\" maps-to \"";
+    WriteAsOperand (std::cerr, i->second, true, true, TF->TraceFn->getParent ());
+    std::cerr << "\")\n";
   }
-  OS << "\n";
+  std::cerr << "\n";
 }
 
 TraceFunction *TraceFunctionBuilder::buildTraceFunction (Trace &T) {
@@ -709,8 +712,6 @@
 			      T.getModule ());
   DEBUG(giveNamesToFunctionArgs (TF->LiveInSet, TF->TraceFn));
   fillInFunctionBody (T, TF->TraceFn, TF->LiveOutSet);
-  
-  DEBUG(cloneMapDump(TF, std::cerr));
   return TF;
 }
 





More information about the llvm-commits mailing list