remove the std::ostream version of module and type printing.
authorChris Lattner <sabre@nondot.org>
Sun, 23 Aug 2009 04:52:46 +0000 (04:52 +0000)
committerChris Lattner <sabre@nondot.org>
Sun, 23 Aug 2009 04:52:46 +0000 (04:52 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79823 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Module.h
include/llvm/Type.h
lib/ExecutionEngine/ExecutionEngine.cpp
lib/ExecutionEngine/Interpreter/Execution.cpp
lib/Transforms/Scalar/Reassociate.cpp
lib/VMCore/AsmWriter.cpp
lib/VMCore/Type.cpp
tools/llvm-prof/llvm-prof.cpp

index aa91af1a4ab7087e95c9436a4ba4a76c5259bfc9..501625df7a3dcb3e127f6c16f7ff5c391de29346 100644 (file)
@@ -468,7 +468,6 @@ public:
 public:
   /// Print the module to an output stream with AssemblyAnnotationWriter.
   void print(raw_ostream &OS, AssemblyAnnotationWriter *AAW) const;
-  void print(std::ostream &OS, AssemblyAnnotationWriter *AAW) const;
   
   /// Dump the module to stderr (for debugging).
   void dump() const;
@@ -482,11 +481,7 @@ public:
 /// @}
 };
 
-/// An iostream inserter for modules.
-inline std::ostream &operator<<(std::ostream &O, const Module &M) {
-  M.print(O, 0);
-  return O;
-}
+/// An raw_ostream inserter for modules.
 inline raw_ostream &operator<<(raw_ostream &O, const Module &M) {
   M.print(O, 0);
   return O;
index b7516323c58a5abea9ed1b37f93e9f33770b28ff..94ebf1e521b8c84b073f033d216323a82cbb903d 100644 (file)
@@ -168,7 +168,6 @@ protected:
 
 public:
   void print(raw_ostream &O) const;
-  void print(std::ostream &O) const;
 
   /// @brief Debugging support: print to stderr
   void dump() const;
@@ -485,7 +484,6 @@ template <> inline bool isa_impl<PointerType, Type>(const Type &Ty) {
   return Ty.getTypeID() == Type::PointerTyID;
 }
 
-std::ostream &operator<<(std::ostream &OS, const Type &T);
 raw_ostream &operator<<(raw_ostream &OS, const Type &T);
 
 } // End llvm namespace
index a20122d9f9c532e93ca618508653ae0b2fa989c1..644740f71a4560401ed571c0e7f4bbfa96f3db57 100644 (file)
@@ -814,7 +814,7 @@ void ExecutionEngine::StoreValueToMemory(const GenericValue &Val,
     *((PointerTy*)Ptr) = Val.PointerVal;
     break;
   default:
-    cerr << "Cannot store value of type " << *Ty << "!\n";
+    errs() << "Cannot store value of type " << *Ty << "!\n";
   }
 
   if (sys::isLittleEndianHost() != getTargetData()->isLittleEndian())
@@ -930,7 +930,7 @@ void ExecutionEngine::InitializeMemory(const Constant *Init, void *Addr) {
     return;
   }
 
-  cerr << "Bad Type: " << *Init->getType() << "\n";
+  errs() << "Bad Type: " << *Init->getType() << "\n";
   llvm_unreachable("Unknown constant type to initialize memory with!");
 }
 
index 31210a7eabf36459877c98e86238160a52d16ccb..bb45b2c441b40e86b9cb8f6ad4d90a41715de9bd 100644 (file)
@@ -737,9 +737,9 @@ void Interpreter::visitAllocationInst(AllocationInst &I) {
   // Allocate enough memory to hold the type...
   void *Memory = malloc(MemToAlloc);
 
-  DOUT << "Allocated Type: " << *Ty << " (" << TypeSize << " bytes) x " 
-       << NumElements << " (Total: " << MemToAlloc << ") at "
-       << uintptr_t(Memory) << '\n';
+  DEBUG(errs() << "Allocated Type: " << *Ty << " (" << TypeSize << " bytes) x " 
+               << NumElements << " (Total: " << MemToAlloc << ") at "
+               << uintptr_t(Memory) << '\n');
 
   GenericValue Result = PTOGV(Memory);
   assert(Result.PointerVal != 0 && "Null pointer returned by malloc!");
@@ -795,7 +795,7 @@ GenericValue Interpreter::executeGEPOperation(Value *Ptr, gep_type_iterator I,
 
   GenericValue Result;
   Result.PointerVal = ((char*)getOperandValue(Ptr, SF).PointerVal) + Total;
-  DOUT << "GEP Index " << Total << " bytes.\n";
+  DEBUG(errs() << "GEP Index " << Total << " bytes.\n");
   return Result;
 }
 
index f6e11bc646fef59c44e22d28725ca553054c5aed..9ef4ea8ffefd923b0942e7097c6cc2a984ce7ac8 100644 (file)
@@ -62,11 +62,11 @@ namespace {
 ///
 static void PrintOps(Instruction *I, const std::vector<ValueEntry> &Ops) {
   Module *M = I->getParent()->getParent()->getParent();
-  cerr << Instruction::getOpcodeName(I->getOpcode()) << " "
+  errs() << Instruction::getOpcodeName(I->getOpcode()) << " "
        << *Ops[0].Op->getType();
   for (unsigned i = 0, e = Ops.size(); i != e; ++i) {
-    WriteAsOperand(*cerr.stream() << " ", Ops[i].Op, false, M);
-    cerr << "," << Ops[i].Rank;
+    WriteAsOperand(errs() << " ", Ops[i].Op, false, M);
+    errs() << "," << Ops[i].Rank;
   }
 }
 #endif
index 696cd6f5c47f49587c68e3c4e59b1859b145cd16..dc72031482b6a01f6daff240e5b5a7097b999e84 100644 (file)
@@ -1999,10 +1999,6 @@ void AssemblyWriter::printInstruction(const Instruction &I) {
 //                       External Interface declarations
 //===----------------------------------------------------------------------===//
 
-void Module::print(std::ostream &o, AssemblyAnnotationWriter *AAW) const {
-  raw_os_ostream OS(o);
-  print(OS, AAW);
-}
 void Module::print(raw_ostream &ROS, AssemblyAnnotationWriter *AAW) const {
   SlotTracker SlotTable(this);
   formatted_raw_ostream OS(ROS);
@@ -2010,11 +2006,6 @@ void Module::print(raw_ostream &ROS, AssemblyAnnotationWriter *AAW) const {
   W.write(this);
 }
 
-void Type::print(std::ostream &o) const {
-  raw_os_ostream OS(o);
-  print(OS);
-}
-
 void Type::print(raw_ostream &OS) const {
   if (this == 0) {
     OS << "<null Type>";
index 3f64e81f92fbf41e0e1208925c1e5dfb14ad2163..36dcbccdce773dee547a83c907cc85c18d41e54d 100644 (file)
@@ -1208,19 +1208,6 @@ bool SequentialType::indexValid(const Value *V) const {
 }
 
 namespace llvm {
-std::ostream &operator<<(std::ostream &OS, const Type *T) {
-  if (T == 0)
-    OS << "<null> value!\n";
-  else
-    T->print(OS);
-  return OS;
-}
-
-std::ostream &operator<<(std::ostream &OS, const Type &T) {
-  T.print(OS);
-  return OS;
-}
-
 raw_ostream &operator<<(raw_ostream &OS, const Type &T) {
   T.print(OS);
   return OS;
index 1950b49cc5eb27504f26e98b40c34a0db6169eeb..4110370f3bc084869eb74efe6306d6bbf1f8d35e 100644 (file)
@@ -238,7 +238,7 @@ bool ProfileInfoPrinterPass::runOnModule(Module &M) {
     ProfileAnnotator PA(PI);
 
     if (FunctionsToPrint.empty() || PrintAllCode)
-      M.print(std::cout, &PA);
+      M.print(outs(), &PA);
     else
       // Print just a subset of the functions.
       for (std::set<Function*>::iterator I = FunctionsToPrint.begin(),