remove the std::ostream version of module and type printing.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79823 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/include/llvm/Module.h b/include/llvm/Module.h
index aa91af1..501625d 100644
--- a/include/llvm/Module.h
+++ b/include/llvm/Module.h
@@ -468,7 +468,6 @@
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 @@
/// @}
};
-/// 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;
diff --git a/include/llvm/Type.h b/include/llvm/Type.h
index b751632..94ebf1e 100644
--- a/include/llvm/Type.h
+++ b/include/llvm/Type.h
@@ -168,7 +168,6 @@
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 @@
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
diff --git a/lib/ExecutionEngine/ExecutionEngine.cpp b/lib/ExecutionEngine/ExecutionEngine.cpp
index a20122d..644740f 100644
--- a/lib/ExecutionEngine/ExecutionEngine.cpp
+++ b/lib/ExecutionEngine/ExecutionEngine.cpp
@@ -814,7 +814,7 @@
*((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 @@
return;
}
- cerr << "Bad Type: " << *Init->getType() << "\n";
+ errs() << "Bad Type: " << *Init->getType() << "\n";
llvm_unreachable("Unknown constant type to initialize memory with!");
}
diff --git a/lib/ExecutionEngine/Interpreter/Execution.cpp b/lib/ExecutionEngine/Interpreter/Execution.cpp
index 31210a7..bb45b2c 100644
--- a/lib/ExecutionEngine/Interpreter/Execution.cpp
+++ b/lib/ExecutionEngine/Interpreter/Execution.cpp
@@ -737,9 +737,9 @@
// 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 Result;
Result.PointerVal = ((char*)getOperandValue(Ptr, SF).PointerVal) + Total;
- DOUT << "GEP Index " << Total << " bytes.\n";
+ DEBUG(errs() << "GEP Index " << Total << " bytes.\n");
return Result;
}
diff --git a/lib/Transforms/Scalar/Reassociate.cpp b/lib/Transforms/Scalar/Reassociate.cpp
index f6e11bc..9ef4ea8 100644
--- a/lib/Transforms/Scalar/Reassociate.cpp
+++ b/lib/Transforms/Scalar/Reassociate.cpp
@@ -62,11 +62,11 @@
///
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
diff --git a/lib/VMCore/AsmWriter.cpp b/lib/VMCore/AsmWriter.cpp
index 696cd6f..dc72031 100644
--- a/lib/VMCore/AsmWriter.cpp
+++ b/lib/VMCore/AsmWriter.cpp
@@ -1999,10 +1999,6 @@
// 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 @@
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>";
diff --git a/lib/VMCore/Type.cpp b/lib/VMCore/Type.cpp
index 3f64e81..36dcbcc 100644
--- a/lib/VMCore/Type.cpp
+++ b/lib/VMCore/Type.cpp
@@ -1208,19 +1208,6 @@
}
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;
diff --git a/tools/llvm-prof/llvm-prof.cpp b/tools/llvm-prof/llvm-prof.cpp
index 1950b49..4110370 100644
--- a/tools/llvm-prof/llvm-prof.cpp
+++ b/tools/llvm-prof/llvm-prof.cpp
@@ -238,7 +238,7 @@
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(),