X-Git-Url: http://plrg.eecs.uci.edu/git/?a=blobdiff_plain;f=lib%2FAnalysis%2FTrace.cpp;h=5a1acc00fb94ad59e23adc427711fc30b8cc8e26;hb=d8def4abd185c430d7649be9347778612c296871;hp=8f19fda953dd7ed45ef5434c59e64a66ebfd378e;hpb=4ee451de366474b9c228b4e5fa573795a715216d;p=oota-llvm.git diff --git a/lib/Analysis/Trace.cpp b/lib/Analysis/Trace.cpp index 8f19fda953d..5a1acc00fb9 100644 --- a/lib/Analysis/Trace.cpp +++ b/lib/Analysis/Trace.cpp @@ -16,9 +16,9 @@ //===----------------------------------------------------------------------===// #include "llvm/Analysis/Trace.h" -#include "llvm/Function.h" -#include "llvm/Assembly/Writer.h" -#include "llvm/Support/Streams.h" +#include "llvm/IR/Function.h" +#include "llvm/Support/Debug.h" +#include "llvm/Support/raw_ostream.h" using namespace llvm; Function *Trace::getFunction() const { @@ -31,20 +31,22 @@ Module *Trace::getModule() const { /// print - Write trace to output stream. /// -void Trace::print(std::ostream &O) const { - Function *F = getFunction (); +void Trace::print(raw_ostream &O) const { + Function *F = getFunction(); O << "; Trace from function " << F->getName() << ", blocks:\n"; for (const_iterator i = begin(), e = end(); i != e; ++i) { O << "; "; - WriteAsOperand(O, *i, true, getModule()); + (*i)->printAsOperand(O, true, getModule()); O << "\n"; } O << "; Trace parent function: \n" << *F; } +#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) /// dump - Debugger convenience method; writes trace to standard error /// output stream. /// void Trace::dump() const { - print(cerr); + print(dbgs()); } +#endif