- virtual void print(std::ostream &O, const Module *M) const;
+ virtual void print(llvm::OStream &O, const Module *M) const;
The print method must be implemented by "analyses" in order to print
@@ -871,7 +871,7 @@ a human readable version of the analysis results. This is useful for debugging
an analysis itself, as well as for other people to figure out how an analysis
works. Use the opt -analyze argument to invoke this method.
-
The ostream parameter specifies the stream to write the results on,
+
The llvm::OStream parameter specifies the stream to write the results on,
and the Module parameter gives a pointer to the top level module of the
program that has been analyzed. Note however that this pointer may be null in
certain circumstances (such as calling the Pass::dump() from a
diff --git a/lib/CodeGen/MachineDebugInfo.cpp b/lib/CodeGen/MachineDebugInfo.cpp
index 48db413d536..bc75ccb7a65 100644
--- a/lib/CodeGen/MachineDebugInfo.cpp
+++ b/lib/CodeGen/MachineDebugInfo.cpp
@@ -21,9 +21,7 @@
#include "llvm/Instructions.h"
#include "llvm/Module.h"
#include "llvm/Support/Dwarf.h"
-
-#include
-
+#include "llvm/Support/Streams.h"
using namespace llvm;
using namespace llvm::dwarf;
@@ -589,10 +587,10 @@ const char *AnchorDesc::getTypeString() const {
#ifndef NDEBUG
void AnchorDesc::dump() {
- std::cerr << getDescString() << " "
- << "Version(" << getVersion() << "), "
- << "Tag(" << getTag() << "), "
- << "AnchorTag(" << AnchorTag << ")\n";
+ cerr << getDescString() << " "
+ << "Version(" << getVersion() << "), "
+ << "Tag(" << getTag() << "), "
+ << "AnchorTag(" << AnchorTag << ")\n";
}
#endif
@@ -664,14 +662,14 @@ const char *CompileUnitDesc::getAnchorString() const {
#ifndef NDEBUG
void CompileUnitDesc::dump() {
- std::cerr << getDescString() << " "
- << "Version(" << getVersion() << "), "
- << "Tag(" << getTag() << "), "
- << "Anchor(" << getAnchor() << "), "
- << "Language(" << Language << "), "
- << "FileName(\"" << FileName << "\"), "
- << "Directory(\"" << Directory << "\"), "
- << "Producer(\"" << Producer << "\")\n";
+ cerr << getDescString() << " "
+ << "Version(" << getVersion() << "), "
+ << "Tag(" << getTag() << "), "
+ << "Anchor(" << getAnchor() << "), "
+ << "Language(" << Language << "), "
+ << "FileName(\"" << FileName << "\"), "
+ << "Directory(\"" << Directory << "\"), "
+ << "Producer(\"" << Producer << "\")\n";
}
#endif
@@ -718,17 +716,17 @@ const char *TypeDesc::getTypeString() const {
#ifndef NDEBUG
void TypeDesc::dump() {
- std::cerr << getDescString() << " "
- << "Version(" << getVersion() << "), "
- << "Tag(" << getTag() << "), "
- << "Context(" << Context << "), "
- << "Name(\"" << Name << "\"), "
- << "File(" << File << "), "
- << "Line(" << Line << "), "
- << "Size(" << Size << "), "
- << "Align(" << Align << "), "
- << "Offset(" << Offset << "), "
- << "Flags(" << Flags << ")\n";
+ cerr << getDescString() << " "
+ << "Version(" << getVersion() << "), "
+ << "Tag(" << getTag() << "), "
+ << "Context(" << Context << "), "
+ << "Name(\"" << Name << "\"), "
+ << "File(" << File << "), "
+ << "Line(" << Line << "), "
+ << "Size(" << Size << "), "
+ << "Align(" << Align << "), "
+ << "Offset(" << Offset << "), "
+ << "Flags(" << Flags << ")\n";
}
#endif
@@ -766,13 +764,13 @@ const char *BasicTypeDesc::getTypeString() const {
#ifndef NDEBUG
void BasicTypeDesc::dump() {
- std::cerr << getDescString() << " "
- << "Version(" << getVersion() << "), "
- << "Tag(" << getTag() << "), "
- << "Context(" << getContext() << "), "
- << "Name(\"" << getName() << "\"), "
- << "Size(" << getSize() << "), "
- << "Encoding(" << Encoding << ")\n";
+ cerr << getDescString() << " "
+ << "Version(" << getVersion() << "), "
+ << "Tag(" << getTag() << "), "
+ << "Context(" << getContext() << "), "
+ << "Name(\"" << getName() << "\"), "
+ << "Size(" << getSize() << "), "
+ << "Encoding(" << Encoding << ")\n";
}
#endif
@@ -823,15 +821,15 @@ const char *DerivedTypeDesc::getTypeString() const {
#ifndef NDEBUG
void DerivedTypeDesc::dump() {
- std::cerr << getDescString() << " "
- << "Version(" << getVersion() << "), "
- << "Tag(" << getTag() << "), "
- << "Context(" << getContext() << "), "
- << "Name(\"" << getName() << "\"), "
- << "Size(" << getSize() << "), "
- << "File(" << getFile() << "), "
- << "Line(" << getLine() << "), "
- << "FromType(" << FromType << ")\n";
+ cerr << getDescString() << " "
+ << "Version(" << getVersion() << "), "
+ << "Tag(" << getTag() << "), "
+ << "Context(" << getContext() << "), "
+ << "Name(\"" << getName() << "\"), "
+ << "Size(" << getSize() << "), "
+ << "File(" << getFile() << "), "
+ << "Line(" << getLine() << "), "
+ << "FromType(" << FromType << ")\n";
}
#endif
@@ -880,16 +878,16 @@ const char *CompositeTypeDesc::getTypeString() const {
#ifndef NDEBUG
void CompositeTypeDesc::dump() {
- std::cerr << getDescString() << " "
- << "Version(" << getVersion() << "), "
- << "Tag(" << getTag() << "), "
- << "Context(" << getContext() << "), "
- << "Name(\"" << getName() << "\"), "
- << "Size(" << getSize() << "), "
- << "File(" << getFile() << "), "
- << "Line(" << getLine() << "), "
- << "FromType(" << getFromType() << "), "
- << "Elements.size(" << Elements.size() << ")\n";
+ cerr << getDescString() << " "
+ << "Version(" << getVersion() << "), "
+ << "Tag(" << getTag() << "), "
+ << "Context(" << getContext() << "), "
+ << "Name(\"" << getName() << "\"), "
+ << "Size(" << getSize() << "), "
+ << "File(" << getFile() << "), "
+ << "Line(" << getLine() << "), "
+ << "FromType(" << getFromType() << "), "
+ << "Elements.size(" << Elements.size() << ")\n";
}
#endif
@@ -929,11 +927,11 @@ const char *SubrangeDesc::getTypeString() const {
#ifndef NDEBUG
void SubrangeDesc::dump() {
- std::cerr << getDescString() << " "
- << "Version(" << getVersion() << "), "
- << "Tag(" << getTag() << "), "
- << "Lo(" << Lo << "), "
- << "Hi(" << Hi << ")\n";
+ cerr << getDescString() << " "
+ << "Version(" << getVersion() << "), "
+ << "Tag(" << getTag() << "), "
+ << "Lo(" << Lo << "), "
+ << "Hi(" << Hi << ")\n";
}
#endif
@@ -973,11 +971,11 @@ const char *EnumeratorDesc::getTypeString() const {
#ifndef NDEBUG
void EnumeratorDesc::dump() {
- std::cerr << getDescString() << " "
- << "Version(" << getVersion() << "), "
- << "Tag(" << getTag() << "), "
- << "Name(" << Name << "), "
- << "Value(" << Value << ")\n";
+ cerr << getDescString() << " "
+ << "Version(" << getVersion() << "), "
+ << "Tag(" << getTag() << "), "
+ << "Name(" << Name << "), "
+ << "Value(" << Value << ")\n";
}
#endif
@@ -1031,14 +1029,14 @@ const char *VariableDesc::getTypeString() const {
#ifndef NDEBUG
void VariableDesc::dump() {
- std::cerr << getDescString() << " "
- << "Version(" << getVersion() << "), "
- << "Tag(" << getTag() << "), "
- << "Context(" << Context << "), "
- << "Name(\"" << Name << "\"), "
- << "File(" << File << "), "
- << "Line(" << Line << "), "
- << "TyDesc(" << TyDesc << ")\n";
+ cerr << getDescString() << " "
+ << "Version(" << getVersion() << "), "
+ << "Tag(" << getTag() << "), "
+ << "Context(" << Context << "), "
+ << "Name(\"" << Name << "\"), "
+ << "File(" << File << "), "
+ << "Line(" << Line << "), "
+ << "TyDesc(" << TyDesc << ")\n";
}
#endif
@@ -1114,19 +1112,19 @@ const char *GlobalVariableDesc::getAnchorString() const {
#ifndef NDEBUG
void GlobalVariableDesc::dump() {
- std::cerr << getDescString() << " "
- << "Version(" << getVersion() << "), "
- << "Tag(" << getTag() << "), "
- << "Anchor(" << getAnchor() << "), "
- << "Name(\"" << getName() << "\"), "
- << "FullName(\"" << getFullName() << "\"), "
- << "LinkageName(\"" << getLinkageName() << "\"), "
- << "File(" << getFile() << "),"
- << "Line(" << getLine() << "),"
- << "Type(" << getType() << "), "
- << "IsStatic(" << (isStatic() ? "true" : "false") << "), "
- << "IsDefinition(" << (isDefinition() ? "true" : "false") << "), "
- << "Global(" << Global << ")\n";
+ cerr << getDescString() << " "
+ << "Version(" << getVersion() << "), "
+ << "Tag(" << getTag() << "), "
+ << "Anchor(" << getAnchor() << "), "
+ << "Name(\"" << getName() << "\"), "
+ << "FullName(\"" << getFullName() << "\"), "
+ << "LinkageName(\"" << getLinkageName() << "\"), "
+ << "File(" << getFile() << "),"
+ << "Line(" << getLine() << "),"
+ << "Type(" << getType() << "), "
+ << "IsStatic(" << (isStatic() ? "true" : "false") << "), "
+ << "IsDefinition(" << (isDefinition() ? "true" : "false") << "), "
+ << "Global(" << Global << ")\n";
}
#endif
@@ -1168,18 +1166,18 @@ const char *SubprogramDesc::getAnchorString() const {
#ifndef NDEBUG
void SubprogramDesc::dump() {
- std::cerr << getDescString() << " "
- << "Version(" << getVersion() << "), "
- << "Tag(" << getTag() << "), "
- << "Anchor(" << getAnchor() << "), "
- << "Name(\"" << getName() << "\"), "
- << "FullName(\"" << getFullName() << "\"), "
- << "LinkageName(\"" << getLinkageName() << "\"), "
- << "File(" << getFile() << "),"
- << "Line(" << getLine() << "),"
- << "Type(" << getType() << "), "
- << "IsStatic(" << (isStatic() ? "true" : "false") << "), "
- << "IsDefinition(" << (isDefinition() ? "true" : "false") << ")\n";
+ cerr << getDescString() << " "
+ << "Version(" << getVersion() << "), "
+ << "Tag(" << getTag() << "), "
+ << "Anchor(" << getAnchor() << "), "
+ << "Name(\"" << getName() << "\"), "
+ << "FullName(\"" << getFullName() << "\"), "
+ << "LinkageName(\"" << getLinkageName() << "\"), "
+ << "File(" << getFile() << "),"
+ << "Line(" << getLine() << "),"
+ << "Type(" << getType() << "), "
+ << "IsStatic(" << (isStatic() ? "true" : "false") << "), "
+ << "IsDefinition(" << (isDefinition() ? "true" : "false") << ")\n";
}
#endif
@@ -1217,10 +1215,10 @@ const char *BlockDesc::getTypeString() const {
#ifndef NDEBUG
void BlockDesc::dump() {
- std::cerr << getDescString() << " "
- << "Version(" << getVersion() << "), "
- << "Tag(" << getTag() << "),"
- << "Context(" << Context << ")\n";
+ cerr << getDescString() << " "
+ << "Version(" << getVersion() << "), "
+ << "Tag(" << getTag() << "),"
+ << "Context(" << Context << ")\n";
}
#endif
diff --git a/lib/CodeGen/RegAllocLocal.cpp b/lib/CodeGen/RegAllocLocal.cpp
index 8d10ff703b0..876eb950d9e 100644
--- a/lib/CodeGen/RegAllocLocal.cpp
+++ b/lib/CodeGen/RegAllocLocal.cpp
@@ -758,7 +758,7 @@ void RA::AllocateBasicBlock(MachineBasicBlock &MBB) {
for (unsigned i = MRegisterInfo::FirstVirtualRegister,
e = MF->getSSARegMap()->getLastVirtReg(); i <= e; ++i)
if (unsigned PR = Virt2PhysRegMap[i]) {
- std::cerr << "Register still mapped: " << i << " -> " << PR << "\n";
+ cerr << "Register still mapped: " << i << " -> " << PR << "\n";
AllOk = false;
}
assert(AllOk && "Virtual registers still in phys regs?");
diff --git a/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
index 2f8ad80e5c6..b8439a62bee 100644
--- a/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
+++ b/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
@@ -38,8 +38,6 @@
#include "llvm/Support/Compiler.h"
#include "llvm/Support/CommandLine.h"
#include
-#include
-#include
using namespace llvm;
namespace {
@@ -101,9 +99,9 @@ namespace {
bool AddTo = true) {
assert(N->getNumValues() == NumTo && "Broken CombineTo call!");
++NodesCombined;
- DEBUG(std::cerr << "\nReplacing.1 "; N->dump();
- std::cerr << "\nWith: "; To[0].Val->dump(&DAG);
- std::cerr << " and " << NumTo-1 << " other values\n");
+ DOUT << "\nReplacing.1 "; DEBUG(N->dump());
+ DOUT << "\nWith: "; DEBUG(To[0].Val->dump(&DAG));
+ DOUT << " and " << NumTo-1 << " other values\n";
std::vector NowDead;
DAG.ReplaceAllUsesWith(N, To, &NowDead);
@@ -152,9 +150,9 @@ namespace {
// Replace the old value with the new one.
++NodesCombined;
- DEBUG(std::cerr << "\nReplacing.2 "; TLO.Old.Val->dump();
- std::cerr << "\nWith: "; TLO.New.Val->dump(&DAG);
- std::cerr << '\n');
+ DOUT << "\nReplacing.2 "; DEBUG(TLO.Old.Val->dump());
+ DOUT << "\nWith: "; DEBUG(TLO.New.Val->dump(&DAG));
+ DOUT << '\n';
std::vector NowDead;
DAG.ReplaceAllUsesOfValueWith(TLO.Old, TLO.New, NowDead);
@@ -455,9 +453,9 @@ void DAGCombiner::Run(bool RunningAfterLegalize) {
RV.Val->getOpcode() != ISD::DELETED_NODE &&
"Node was deleted but visit returned new node!");
- DEBUG(std::cerr << "\nReplacing.3 "; N->dump();
- std::cerr << "\nWith: "; RV.Val->dump(&DAG);
- std::cerr << '\n');
+ DOUT << "\nReplacing.3 "; DEBUG(N->dump());
+ DOUT << "\nWith: "; DEBUG(RV.Val->dump(&DAG));
+ DOUT << '\n';
std::vector NowDead;
if (N->getNumValues() == RV.Val->getNumValues())
DAG.ReplaceAllUsesWith(N, RV.Val, &NowDead);
@@ -2801,9 +2799,9 @@ bool DAGCombiner::CombineToPreIndexedLoadStore(SDNode *N) {
Result = DAG.getIndexedStore(SDOperand(N,0), BasePtr, Offset, AM);
++PreIndexedNodes;
++NodesCombined;
- DEBUG(std::cerr << "\nReplacing.4 "; N->dump();
- std::cerr << "\nWith: "; Result.Val->dump(&DAG);
- std::cerr << '\n');
+ DOUT << "\nReplacing.4 "; DEBUG(N->dump());
+ DOUT << "\nWith: "; DEBUG(Result.Val->dump(&DAG));
+ DOUT << '\n';
std::vector NowDead;
if (isLoad) {
DAG.ReplaceAllUsesOfValueWith(SDOperand(N, 0), Result.getValue(0),
@@ -2924,9 +2922,9 @@ bool DAGCombiner::CombineToPostIndexedLoadStore(SDNode *N) {
: DAG.getIndexedStore(SDOperand(N,0), BasePtr, Offset, AM);
++PostIndexedNodes;
++NodesCombined;
- DEBUG(std::cerr << "\nReplacing.5 "; N->dump();
- std::cerr << "\nWith: "; Result.Val->dump(&DAG);
- std::cerr << '\n');
+ DOUT << "\nReplacing.5 "; DEBUG(N->dump());
+ DOUT << "\nWith: "; DEBUG(Result.Val->dump(&DAG));
+ DOUT << '\n';
std::vector NowDead;
if (isLoad) {
DAG.ReplaceAllUsesOfValueWith(SDOperand(N, 0), Result.getValue(0),
diff --git a/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp b/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
index bf467b733d0..0d8ca7bd2eb 100644
--- a/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
+++ b/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
@@ -24,7 +24,6 @@
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/Compiler.h"
#include "llvm/ADT/SmallVector.h"
-#include
#include