summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-08-23 06:03:38 +0000
committerChris Lattner <sabre@nondot.org>2009-08-23 06:03:38 +0000
commit45cfe545ec8177262dabc70580ce05feaa1c3880 (patch)
treed7e42a138f6f8b54e1a831aff3c73c653ee77784 /include
parentcb3e3d30054edfc7481bf323b315da4edc63bc44 (diff)
downloadllvm-45cfe545ec8177262dabc70580ce05feaa1c3880.tar.gz
llvm-45cfe545ec8177262dabc70580ce05feaa1c3880.tar.bz2
llvm-45cfe545ec8177262dabc70580ce05feaa1c3880.tar.xz
Change Pass::print to take a raw ostream instead of std::ostream,
update all code that this affects. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79830 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm/Analysis/CallGraph.h7
-rw-r--r--include/llvm/Analysis/Dominators.h5
-rw-r--r--include/llvm/Analysis/FindUsedTypes.h3
-rw-r--r--include/llvm/Analysis/Interval.h5
-rw-r--r--include/llvm/Analysis/IntervalPartition.h5
-rw-r--r--include/llvm/Analysis/LoopInfo.h2
-rw-r--r--include/llvm/Analysis/LoopVR.h3
-rw-r--r--include/llvm/Analysis/PostDominators.h2
-rw-r--r--include/llvm/Analysis/ScalarEvolution.h6
-rw-r--r--include/llvm/CodeGen/LiveIntervalAnalysis.h2
-rw-r--r--include/llvm/CodeGen/LiveStackAnalysis.h2
-rw-r--r--include/llvm/CodeGen/MachineDominators.h2
-rw-r--r--include/llvm/Pass.h9
-rw-r--r--include/llvm/Support/ConstantRange.h2
-rw-r--r--include/llvm/Support/PassNameParser.h2
-rw-r--r--include/llvm/Support/raw_ostream.h2
16 files changed, 19 insertions, 40 deletions
diff --git a/include/llvm/Analysis/CallGraph.h b/include/llvm/Analysis/CallGraph.h
index de839694dc..c36cb22780 100644
--- a/include/llvm/Analysis/CallGraph.h
+++ b/include/llvm/Analysis/CallGraph.h
@@ -155,9 +155,7 @@ public:
///
void initialize(Module &M);
- virtual void print(std::ostream &o, const Module *M) const;
- void print(std::ostream *o, const Module *M) const { if (o) print(*o, M); }
- void dump() const;
+ void print(raw_ostream &o, Module *) const;
protected:
// destroy - Release memory for the call graph
@@ -202,8 +200,7 @@ public:
/// dump - Print out this call graph node.
///
void dump() const;
- void print(std::ostream &OS) const;
- void print(std::ostream *OS) const { if (OS) print(*OS); }
+ void print(raw_ostream &OS) const;
//===---------------------------------------------------------------------
// Methods to keep a call graph up to date with a function that has been
diff --git a/include/llvm/Analysis/Dominators.h b/include/llvm/Analysis/Dominators.h
index 094fecf107..412f8ccf6d 100644
--- a/include/llvm/Analysis/Dominators.h
+++ b/include/llvm/Analysis/Dominators.h
@@ -22,7 +22,6 @@
#define LLVM_ANALYSIS_DOMINATORS_H
#include "llvm/Pass.h"
-#include "llvm/BasicBlock.h"
#include "llvm/Function.h"
#include "llvm/Instructions.h"
#include "llvm/ADT/DenseMap.h"
@@ -830,7 +829,7 @@ public:
DT->releaseMemory();
}
- virtual void print(std::ostream &OS, const Module* M= 0) const;
+ virtual void print(raw_ostream &OS, const Module* M= 0) const;
};
//===-------------------------------------
@@ -978,7 +977,7 @@ public:
/// print - Convert to human readable form
///
- virtual void print(std::ostream &OS, const Module* = 0) const;
+ virtual void print(raw_ostream &OS, const Module* = 0) const;
};
diff --git a/include/llvm/Analysis/FindUsedTypes.h b/include/llvm/Analysis/FindUsedTypes.h
index c897af3a58..1337385848 100644
--- a/include/llvm/Analysis/FindUsedTypes.h
+++ b/include/llvm/Analysis/FindUsedTypes.h
@@ -37,8 +37,7 @@ public:
/// passed in, then the types are printed symbolically if possible, using the
/// symbol table from the module.
///
- void print(std::ostream &o, const Module *M) const;
- void print(std::ostream *o, const Module *M) const { if (o) print(*o, M); }
+ void print(raw_ostream &o, const Module *M) const;
private:
/// IncorporateType - Incorporate one type and all of its subtypes into the
diff --git a/include/llvm/Analysis/Interval.h b/include/llvm/Analysis/Interval.h
index 1da2022f69..ca8ad73131 100644
--- a/include/llvm/Analysis/Interval.h
+++ b/include/llvm/Analysis/Interval.h
@@ -22,11 +22,11 @@
#include "llvm/ADT/GraphTraits.h"
#include <vector>
-#include <iosfwd>
namespace llvm {
class BasicBlock;
+class raw_ostream;
//===----------------------------------------------------------------------===//
//
@@ -98,8 +98,7 @@ public:
bool isLoop() const;
/// print - Show contents in human readable format...
- void print(std::ostream &O) const;
- void print(std::ostream *O) const { if (O) print(*O); }
+ void print(raw_ostream &O) const;
};
/// succ_begin/succ_end - define methods so that Intervals may be used
diff --git a/include/llvm/Analysis/IntervalPartition.h b/include/llvm/Analysis/IntervalPartition.h
index feae6d82f8..c1214e7427 100644
--- a/include/llvm/Analysis/IntervalPartition.h
+++ b/include/llvm/Analysis/IntervalPartition.h
@@ -60,10 +60,7 @@ public:
IntervalPartition(IntervalPartition &I, bool);
// print - Show contents in human readable format...
- virtual void print(std::ostream &O, const Module* = 0) const;
- void print(std::ostream *O, const Module* M = 0) const {
- if (O) print(*O, M);
- }
+ virtual void print(raw_ostream &O, const Module* = 0) const;
// getRootInterval() - Return the root interval that contains the starting
// block of the function.
diff --git a/include/llvm/Analysis/LoopInfo.h b/include/llvm/Analysis/LoopInfo.h
index 5435226283..3a09e7b058 100644
--- a/include/llvm/Analysis/LoopInfo.h
+++ b/include/llvm/Analysis/LoopInfo.h
@@ -938,7 +938,7 @@ public:
virtual void releaseMemory() { LI.releaseMemory(); }
- virtual void print(std::ostream &O, const Module* M = 0) const;
+ virtual void print(raw_ostream &O, const Module* M = 0) const;
virtual void getAnalysisUsage(AnalysisUsage &AU) const;
diff --git a/include/llvm/Analysis/LoopVR.h b/include/llvm/Analysis/LoopVR.h
index a9f6636d79..3b098e6ca1 100644
--- a/include/llvm/Analysis/LoopVR.h
+++ b/include/llvm/Analysis/LoopVR.h
@@ -17,7 +17,6 @@
#include "llvm/Pass.h"
#include "llvm/Analysis/ScalarEvolution.h"
#include "llvm/Support/ConstantRange.h"
-#include <iosfwd>
#include <map>
namespace llvm {
@@ -33,7 +32,7 @@ public:
LoopVR() : FunctionPass(&ID) {}
bool runOnFunction(Function &F);
- virtual void print(std::ostream &os, const Module *) const;
+ virtual void print(raw_ostream &os, const Module *) const;
void releaseMemory();
void getAnalysisUsage(AnalysisUsage &AU) const;
diff --git a/include/llvm/Analysis/PostDominators.h b/include/llvm/Analysis/PostDominators.h
index ff579e3c4a..6c9e05fd4b 100644
--- a/include/llvm/Analysis/PostDominators.h
+++ b/include/llvm/Analysis/PostDominators.h
@@ -57,7 +57,7 @@ struct PostDominatorTree : public FunctionPass {
return DT->properlyDominates(A, B);
}
- virtual void print(std::ostream &OS, const Module*) const;
+ virtual void print(raw_ostream &OS, const Module*) const;
};
FunctionPass* createPostDomTree();
diff --git a/include/llvm/Analysis/ScalarEvolution.h b/include/llvm/Analysis/ScalarEvolution.h
index 558cd011f5..ea25853eda 100644
--- a/include/llvm/Analysis/ScalarEvolution.h
+++ b/include/llvm/Analysis/ScalarEvolution.h
@@ -601,11 +601,7 @@ namespace llvm {
virtual bool runOnFunction(Function &F);
virtual void releaseMemory();
virtual void getAnalysisUsage(AnalysisUsage &AU) const;
- void print(raw_ostream &OS, const Module* = 0) const;
- virtual void print(std::ostream &OS, const Module* = 0) const;
- void print(std::ostream *OS, const Module* M = 0) const {
- if (OS) print(*OS, M);
- }
+ virtual void print(raw_ostream &OS, const Module* = 0) const;
private:
FoldingSet<SCEV> UniqueSCEVs;
diff --git a/include/llvm/CodeGen/LiveIntervalAnalysis.h b/include/llvm/CodeGen/LiveIntervalAnalysis.h
index b20cc6e212..da9ff30edf 100644
--- a/include/llvm/CodeGen/LiveIntervalAnalysis.h
+++ b/include/llvm/CodeGen/LiveIntervalAnalysis.h
@@ -347,7 +347,7 @@ namespace llvm {
virtual bool runOnMachineFunction(MachineFunction&);
/// print - Implement the dump method.
- virtual void print(std::ostream &O, const Module* = 0) const;
+ virtual void print(raw_ostream &O, const Module* = 0) const;
/// addIntervalsForSpills - Create new intervals for spilled defs / uses of
/// the given interval. FIXME: It also returns the weight of the spill slot
diff --git a/include/llvm/CodeGen/LiveStackAnalysis.h b/include/llvm/CodeGen/LiveStackAnalysis.h
index 3d4dbf9370..d63a222475 100644
--- a/include/llvm/CodeGen/LiveStackAnalysis.h
+++ b/include/llvm/CodeGen/LiveStackAnalysis.h
@@ -102,7 +102,7 @@ namespace llvm {
virtual bool runOnMachineFunction(MachineFunction&);
/// print - Implement the dump method.
- virtual void print(std::ostream &O, const Module* = 0) const;
+ virtual void print(raw_ostream &O, const Module* = 0) const;
};
}
diff --git a/include/llvm/CodeGen/MachineDominators.h b/include/llvm/CodeGen/MachineDominators.h
index 1439b1bdfe..e56776b144 100644
--- a/include/llvm/CodeGen/MachineDominators.h
+++ b/include/llvm/CodeGen/MachineDominators.h
@@ -162,7 +162,7 @@ public:
virtual void releaseMemory();
- virtual void print(std::ostream &OS, const Module*) const;
+ virtual void print(raw_ostream &OS, const Module*) const;
};
//===-------------------------------------
diff --git a/include/llvm/Pass.h b/include/llvm/Pass.h
index 374b933095..a214e4fcdd 100644
--- a/include/llvm/Pass.h
+++ b/include/llvm/Pass.h
@@ -30,9 +30,7 @@
#define LLVM_PASS_H
#include "llvm/Support/DataTypes.h"
-#include "llvm/Support/Streams.h"
#include <cassert>
-#include <iosfwd>
#include <utility>
#include <vector>
@@ -47,6 +45,7 @@ class ImmutablePass;
class PMStack;
class AnalysisResolver;
class PMDataManager;
+class raw_ostream;
// AnalysisID - Use the PassInfo to identify a pass...
typedef const PassInfo* AnalysisID;
@@ -103,8 +102,7 @@ public:
/// provide the Module* in case the analysis doesn't need it it can just be
/// ignored.
///
- virtual void print(std::ostream &O, const Module *M) const;
- void print(std::ostream *O, const Module *M) const { if (O) print(*O, M); }
+ virtual void print(raw_ostream &O, const Module *M) const;
void dump() const; // dump - Print to stderr.
/// Each pass is responsible for assigning a pass manager to itself.
@@ -202,9 +200,6 @@ public:
AnalysisType &getAnalysisID(const PassInfo *PI, Function &F);
};
-inline std::ostream &operator<<(std::ostream &OS, const Pass &P) {
- P.print(OS, 0); return OS;
-}
//===----------------------------------------------------------------------===//
/// ModulePass class - This class is used to implement unstructured
diff --git a/include/llvm/Support/ConstantRange.h b/include/llvm/Support/ConstantRange.h
index 3b72b0430f..e9c8c7cb2e 100644
--- a/include/llvm/Support/ConstantRange.h
+++ b/include/llvm/Support/ConstantRange.h
@@ -223,8 +223,6 @@ inline raw_ostream &operator<<(raw_ostream &OS, const ConstantRange &CR) {
return OS;
}
-std::ostream &operator<<(std::ostream &OS, const ConstantRange &CR);
-
} // End llvm namespace
#endif
diff --git a/include/llvm/Support/PassNameParser.h b/include/llvm/Support/PassNameParser.h
index a437e2048e..66ce3f2e20 100644
--- a/include/llvm/Support/PassNameParser.h
+++ b/include/llvm/Support/PassNameParser.h
@@ -66,7 +66,7 @@ public:
virtual void passRegistered(const PassInfo *P) {
if (ignorablePass(P) || !Opt) return;
if (findOption(P->getPassArgument()) != getNumOptions()) {
- cerr << "Two passes with the same argument (-"
+ errs() << "Two passes with the same argument (-"
<< P->getPassArgument() << ") attempted to be registered!\n";
llvm_unreachable(0);
}
diff --git a/include/llvm/Support/raw_ostream.h b/include/llvm/Support/raw_ostream.h
index d9d023cc27..c2252dcb04 100644
--- a/include/llvm/Support/raw_ostream.h
+++ b/include/llvm/Support/raw_ostream.h
@@ -196,7 +196,6 @@ public:
raw_ostream &operator<<(const std::string &Str) {
// Avoid the fast path, it would only increase code size for a marginal win.
-
write(Str.data(), Str.length());
return *this;
}
@@ -220,6 +219,7 @@ public:
this->operator<<(ftostr(N));
return *this;
}
+
/// write_hex - Output \arg N in hexadecimal, without any prefix or padding.
raw_ostream &write_hex(unsigned long long N);