[PM/AA] Run clang-format over LibCallAliasAnalysis prior to making
[oota-llvm.git] / lib / Analysis / Trace.cpp
index 91c7ffa779976637848701a2ee97768ee9a36deb..5a1acc00fb94ad59e23adc427711fc30b8cc8e26 100644 (file)
@@ -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.
 //
 //===----------------------------------------------------------------------===//
 //
 //===----------------------------------------------------------------------===//
 
 #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 {
   return getEntryBasicBlock()->getParent();
 }
 
-
 Module *Trace::getModule() const {
   return getFunction()->getParent();
 }
 
 /// print - Write trace to output stream.
 ///
-void Trace::print(llvm_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 << "; ";
-    if (O.stream())
-      WriteAsOperand(*O.stream(), *i, true, 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(llvm_cerr);
+  print(dbgs());
 }
+#endif