X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=lib%2FAnalysis%2FTrace.cpp;h=4c68322b82823041b8a7ecd9f078e7ac3025b0e1;hb=71857ccdb83b6374f7a791c2dae45ce9934a85af;hp=9fc7b8a2c6aeec8e5f9153601706d4bc63391284;hpb=954da37bb492b519f5c31dc360f2a142567e08b4;p=oota-llvm.git diff --git a/lib/Analysis/Trace.cpp b/lib/Analysis/Trace.cpp index 9fc7b8a2c6a..4c68322b828 100644 --- a/lib/Analysis/Trace.cpp +++ b/lib/Analysis/Trace.cpp @@ -2,8 +2,8 @@ // // The LLVM Compiler Infrastructure // -// This file was developed by the LLVM research group and is distributed under -// the University of Illinois Open Source License. See LICENSE.TXT for details. +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // @@ -16,37 +16,38 @@ //===----------------------------------------------------------------------===// #include "llvm/Analysis/Trace.h" -#include "llvm/Function.h" #include "llvm/Assembly/Writer.h" -#include - +#include "llvm/IR/Function.h" +#include "llvm/Support/Debug.h" +#include "llvm/Support/raw_ostream.h" using namespace llvm; Function *Trace::getFunction() const { return getEntryBasicBlock()->getParent(); } - Module *Trace::getModule() const { return getFunction()->getParent(); } /// print - Write trace to output stream. /// -void Trace::print (std::ostream &O) const { - Function *F = getFunction (); - O << "; Trace from function " << F->getName () << ", blocks:\n"; - for (const_iterator i = begin (), e = end (); i != e; ++i) { +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, true, getModule ()); + WriteAsOperand(O, *i, 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 (std::cerr); +void Trace::dump() const { + print(dbgs()); } +#endif