[llvm-commits] [llvm] r79823 - in /llvm/trunk: 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
Chris Lattner
sabre at nondot.org
Sat Aug 22 21:52:46 PDT 2009
Author: lattner
Date: Sat Aug 22 23:52:46 2009
New Revision: 79823
URL: http://llvm.org/viewvc/llvm-project?rev=79823&view=rev
Log:
remove the std::ostream version of module and type printing.
Modified:
llvm/trunk/include/llvm/Module.h
llvm/trunk/include/llvm/Type.h
llvm/trunk/lib/ExecutionEngine/ExecutionEngine.cpp
llvm/trunk/lib/ExecutionEngine/Interpreter/Execution.cpp
llvm/trunk/lib/Transforms/Scalar/Reassociate.cpp
llvm/trunk/lib/VMCore/AsmWriter.cpp
llvm/trunk/lib/VMCore/Type.cpp
llvm/trunk/tools/llvm-prof/llvm-prof.cpp
Modified: llvm/trunk/include/llvm/Module.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Module.h?rev=79823&r1=79822&r2=79823&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Module.h (original)
+++ llvm/trunk/include/llvm/Module.h Sat Aug 22 23:52:46 2009
@@ -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;
Modified: llvm/trunk/include/llvm/Type.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Type.h?rev=79823&r1=79822&r2=79823&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Type.h (original)
+++ llvm/trunk/include/llvm/Type.h Sat Aug 22 23:52:46 2009
@@ -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
Modified: llvm/trunk/lib/ExecutionEngine/ExecutionEngine.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ExecutionEngine/ExecutionEngine.cpp?rev=79823&r1=79822&r2=79823&view=diff
==============================================================================
--- llvm/trunk/lib/ExecutionEngine/ExecutionEngine.cpp (original)
+++ llvm/trunk/lib/ExecutionEngine/ExecutionEngine.cpp Sat Aug 22 23:52:46 2009
@@ -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!");
}
Modified: llvm/trunk/lib/ExecutionEngine/Interpreter/Execution.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ExecutionEngine/Interpreter/Execution.cpp?rev=79823&r1=79822&r2=79823&view=diff
==============================================================================
--- llvm/trunk/lib/ExecutionEngine/Interpreter/Execution.cpp (original)
+++ llvm/trunk/lib/ExecutionEngine/Interpreter/Execution.cpp Sat Aug 22 23:52:46 2009
@@ -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;
}
Modified: llvm/trunk/lib/Transforms/Scalar/Reassociate.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/Reassociate.cpp?rev=79823&r1=79822&r2=79823&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/Reassociate.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/Reassociate.cpp Sat Aug 22 23:52:46 2009
@@ -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
Modified: llvm/trunk/lib/VMCore/AsmWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/AsmWriter.cpp?rev=79823&r1=79822&r2=79823&view=diff
==============================================================================
--- llvm/trunk/lib/VMCore/AsmWriter.cpp (original)
+++ llvm/trunk/lib/VMCore/AsmWriter.cpp Sat Aug 22 23:52:46 2009
@@ -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>";
Modified: llvm/trunk/lib/VMCore/Type.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Type.cpp?rev=79823&r1=79822&r2=79823&view=diff
==============================================================================
--- llvm/trunk/lib/VMCore/Type.cpp (original)
+++ llvm/trunk/lib/VMCore/Type.cpp Sat Aug 22 23:52:46 2009
@@ -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;
Modified: llvm/trunk/tools/llvm-prof/llvm-prof.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-prof/llvm-prof.cpp?rev=79823&r1=79822&r2=79823&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-prof/llvm-prof.cpp (original)
+++ llvm/trunk/tools/llvm-prof/llvm-prof.cpp Sat Aug 22 23:52:46 2009
@@ -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(),
More information about the llvm-commits
mailing list