[llvm-commits] CVS: llvm/lib/Reoptimizer/LightWtProfiling/Trigger/Trace.cpp

Brian Gaeke gaeke at cs.uiuc.edu
Tue Aug 19 13:20:03 PDT 2003


Changes in directory llvm/lib/Reoptimizer/LightWtProfiling/Trigger:

Trace.cpp added (r1.1)

---
Log message:

print from Trace.h was moved here and reimplemented.


---
Diffs of the changes:

Index: llvm/lib/Reoptimizer/LightWtProfiling/Trigger/Trace.cpp
diff -c /dev/null llvm/lib/Reoptimizer/LightWtProfiling/Trigger/Trace.cpp:1.1
*** /dev/null	Tue Aug 19 13:19:48 2003
--- llvm/lib/Reoptimizer/LightWtProfiling/Trigger/Trace.cpp	Tue Aug 19 13:19:38 2003
***************
*** 0 ****
--- 1,31 ----
+ //===- Trace.cpp - Implementation of Trace class -----------------*- C++ -*--=//
+ //
+ // Represents the sequence of basic blocks (generally associated with some
+ // enclosing function) which make up a trace.
+ //
+ //===----------------------------------------------------------------------===//
+ 
+ #include "Trace.h"
+ #include "llvm/Function.h"
+ #include "llvm/SlotCalculator.h"
+ #include <iostream>
+ 
+ /// print - Write trace to output stream.
+ ///
+ void Trace::print (std::ostream &O) const {
+   Function *F = getFunction ();
+   SlotCalculator Table (F, false);
+   O << "; Trace from function " << F->getName () << ", blocks = (";
+   for (const_iterator i = begin (), e = end (); i != e; ++i) {
+     const BasicBlock *BB = *i;
+     O << "(" << Table.getValSlot (BB) << " \"" << BB->getName () << "\") ";
+   }
+   O << ")\n" << "; Trace parent function: \n" << *F;
+ }
+ 
+ /// dump - Debugger convenience method; writes trace to standard error
+ /// output stream.
+ ///
+ void Trace::dump () const {
+   print (std::cerr);
+ }





More information about the llvm-commits mailing list