aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/Analysis
diff options
context:
space:
mode:
Diffstat (limited to 'include/llvm/Analysis')
-rw-r--r--include/llvm/Analysis/AliasSetTracker.h16
-rw-r--r--include/llvm/Analysis/CallGraph.h8
-rw-r--r--include/llvm/Analysis/Dominators.h15
-rw-r--r--include/llvm/Analysis/FindUsedTypes.h1
-rw-r--r--include/llvm/Analysis/Interval.h1
-rw-r--r--include/llvm/Analysis/IntervalPartition.h3
-rw-r--r--include/llvm/Analysis/LoopInfo.h13
-rw-r--r--include/llvm/Analysis/ScalarEvolution.h18
-rw-r--r--include/llvm/Analysis/ScalarEvolutionExpressions.h7
-rw-r--r--include/llvm/Analysis/Trace.h3
10 files changed, 45 insertions, 40 deletions
diff --git a/include/llvm/Analysis/AliasSetTracker.h b/include/llvm/Analysis/AliasSetTracker.h
index 5fcda16..cd6450f 100644
--- a/include/llvm/Analysis/AliasSetTracker.h
+++ b/include/llvm/Analysis/AliasSetTracker.h
@@ -156,10 +156,8 @@ public:
iterator end() const { return iterator(); }
bool empty() const { return PtrList == 0; }
- void print(OStream &OS) const {
- if (OS.stream()) print(*OS.stream());
- }
void print(std::ostream &OS) const;
+ void print(std::ostream *OS) const { if (OS) print(*OS); }
void dump() const;
/// Define an iterator for alias sets... this is just a forward iterator.
@@ -248,10 +246,6 @@ private:
bool aliasesCallSite(CallSite CS, AliasAnalysis &AA) const;
};
-inline OStream& operator<<(OStream &OS, const AliasSet &AS) {
- AS.print(OS);
- return OS;
-}
inline std::ostream& operator<<(std::ostream &OS, const AliasSet &AS) {
AS.print(OS);
return OS;
@@ -361,10 +355,8 @@ public:
iterator begin() { return AliasSets.begin(); }
iterator end() { return AliasSets.end(); }
- void print(OStream &OS) const {
- if (OS.stream()) print(*OS.stream());
- }
void print(std::ostream &OS) const;
+ void print(std::ostream *OS) const { if (OS) print(*OS); }
void dump() const;
private:
@@ -390,10 +382,6 @@ private:
AliasSet *findAliasSetForCallSite(CallSite CS);
};
-inline OStream& operator<<(OStream &OS, const AliasSetTracker &AST) {
- AST.print(OS);
- return OS;
-}
inline std::ostream& operator<<(std::ostream &OS, const AliasSetTracker &AST) {
AST.print(OS);
return OS;
diff --git a/include/llvm/Analysis/CallGraph.h b/include/llvm/Analysis/CallGraph.h
index 1f737da..24effd8 100644
--- a/include/llvm/Analysis/CallGraph.h
+++ b/include/llvm/Analysis/CallGraph.h
@@ -152,10 +152,8 @@ public:
///
void initialize(Module &M);
- void print(OStream &o, const Module *M) const {
- if (o.stream()) print(*o.stream(), 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;
// stub - dummy function, just ignore it
@@ -201,10 +199,8 @@ public:
/// dump - Print out this call graph node.
///
void dump() const;
- void print(OStream &OS) const {
- if (OS.stream()) print(*OS.stream());
- }
void print(std::ostream &OS) const;
+ void print(std::ostream *OS) const { if (OS) print(*OS); }
//===---------------------------------------------------------------------
// 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 939300f..f29ed83 100644
--- a/include/llvm/Analysis/Dominators.h
+++ b/include/llvm/Analysis/Dominators.h
@@ -144,6 +144,9 @@ public:
/// print - Convert to human readable form
///
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);
+ }
};
//===-------------------------------------
@@ -234,6 +237,9 @@ public:
/// print - Convert to human readable form
///
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);
+ }
/// dominates - Return true if A dominates B. This performs the special
/// checks necessary if A and B are in the same basic block.
@@ -410,6 +416,9 @@ public:
/// print - Convert to human readable form
///
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);
+ }
};
//===-------------------------------------
@@ -546,6 +555,9 @@ public:
/// print - Convert to human readable form
///
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);
+ }
protected:
/// getNode - return the (Post)DominatorTree node for the specified basic
/// block. This is the same as using operator[] on this class.
@@ -635,6 +647,9 @@ public:
/// print - Convert to human readable form
///
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);
+ }
};
diff --git a/include/llvm/Analysis/FindUsedTypes.h b/include/llvm/Analysis/FindUsedTypes.h
index fbf41de..008e30c 100644
--- a/include/llvm/Analysis/FindUsedTypes.h
+++ b/include/llvm/Analysis/FindUsedTypes.h
@@ -34,6 +34,7 @@ public:
/// 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); }
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 b9e1d31..bed815a 100644
--- a/include/llvm/Analysis/Interval.h
+++ b/include/llvm/Analysis/Interval.h
@@ -99,6 +99,7 @@ public:
/// print - Show contents in human readable format...
void print(std::ostream &O) const;
+ void print(std::ostream *O) const { if (O) print(*O); }
};
/// 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 1cc903c..bd998e8 100644
--- a/include/llvm/Analysis/IntervalPartition.h
+++ b/include/llvm/Analysis/IntervalPartition.h
@@ -61,6 +61,9 @@ public:
// 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);
+ }
// 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 238a0f6..62f19e3 100644
--- a/include/llvm/Analysis/LoopInfo.h
+++ b/include/llvm/Analysis/LoopInfo.h
@@ -217,10 +217,10 @@ public:
/// the mapping in the LoopInfo class.
void removeBlockFromLoop(BasicBlock *BB);
- void print(OStream &O, unsigned Depth = 0) const {
- if (O.stream()) print(*O.stream(), Depth);
- }
void print(std::ostream &O, unsigned Depth = 0) const;
+ void print(std::ostream *O, unsigned Depth = 0) const {
+ if (O) print(*O, Depth);
+ }
void dump() const;
private:
friend class LoopInfo;
@@ -283,10 +283,11 @@ public:
virtual bool runOnFunction(Function &F);
virtual void releaseMemory();
- void print(OStream &O, const Module* = 0) const {
- if (O.stream()) print(*O.stream());
- }
+
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 getAnalysisUsage(AnalysisUsage &AU) const;
diff --git a/include/llvm/Analysis/ScalarEvolution.h b/include/llvm/Analysis/ScalarEvolution.h
index 4eb0bb3..4aac284 100644
--- a/include/llvm/Analysis/ScalarEvolution.h
+++ b/include/llvm/Analysis/ScalarEvolution.h
@@ -97,20 +97,14 @@ namespace llvm {
/// print - Print out the internal representation of this scalar to the
/// specified stream. This should really only be used for debugging
/// purposes.
- void print(OStream &OS) const {
- if (OS.stream()) print(*OS.stream());
- }
virtual void print(std::ostream &OS) const = 0;
+ void print(std::ostream *OS) const { if (OS) print(*OS); }
/// dump - This method is used for debugging.
///
void dump() const;
};
- inline OStream &operator<<(OStream &OS, const SCEV &S) {
- S.print(OS);
- return OS;
- }
inline std::ostream &operator<<(std::ostream &OS, const SCEV &S) {
S.print(OS);
return OS;
@@ -128,10 +122,8 @@ namespace llvm {
virtual bool isLoopInvariant(const Loop *L) const;
virtual const Type *getType() const;
virtual bool hasComputableLoopEvolution(const Loop *L) const;
- void print(OStream &OS) const {
- if (OS.stream()) print(*OS.stream());
- }
virtual void print(std::ostream &OS) const;
+ void print(std::ostream *OS) const { if (OS) print(*OS); }
virtual SCEVHandle
replaceSymbolicValuesWithConcrete(const SCEVHandle &Sym,
const SCEVHandle &Conc) const;
@@ -242,10 +234,10 @@ namespace llvm {
virtual bool runOnFunction(Function &F);
virtual void releaseMemory();
virtual void getAnalysisUsage(AnalysisUsage &AU) const;
- void print(OStream &OS, const Module* = 0) const {
- if (OS.stream()) print(*OS.stream());
- }
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);
+ }
};
}
diff --git a/include/llvm/Analysis/ScalarEvolutionExpressions.h b/include/llvm/Analysis/ScalarEvolutionExpressions.h
index ba1b6d4..c261dfc 100644
--- a/include/llvm/Analysis/ScalarEvolutionExpressions.h
+++ b/include/llvm/Analysis/ScalarEvolutionExpressions.h
@@ -62,6 +62,7 @@ namespace llvm {
}
virtual void print(std::ostream &OS) const;
+ void print(std::ostream *OS) const { if (OS) print(*OS); }
/// Methods for support type inquiry through isa, cast, and dyn_cast:
static inline bool classof(const SCEVConstant *S) { return true; }
@@ -108,6 +109,7 @@ namespace llvm {
virtual ConstantRange getValueRange() const;
virtual void print(std::ostream &OS) const;
+ void print(std::ostream *OS) const { if (OS) print(*OS); }
/// Methods for support type inquiry through isa, cast, and dyn_cast:
static inline bool classof(const SCEVTruncateExpr *S) { return true; }
@@ -154,6 +156,7 @@ namespace llvm {
}
virtual void print(std::ostream &OS) const;
+ void print(std::ostream *OS) const { if (OS) print(*OS); }
/// Methods for support type inquiry through isa, cast, and dyn_cast:
static inline bool classof(const SCEVZeroExtendExpr *S) { return true; }
@@ -218,6 +221,7 @@ namespace llvm {
virtual const Type *getType() const { return getOperand(0)->getType(); }
virtual void print(std::ostream &OS) const;
+ void print(std::ostream *OS) const { if (OS) print(*OS); }
/// Methods for support type inquiry through isa, cast, and dyn_cast:
static inline bool classof(const SCEVCommutativeExpr *S) { return true; }
@@ -332,6 +336,7 @@ namespace llvm {
virtual const Type *getType() const;
void print(std::ostream &OS) const;
+ void print(std::ostream *OS) const { if (OS) print(*OS); }
/// Methods for support type inquiry through isa, cast, and dyn_cast:
static inline bool classof(const SCEVSDivExpr *S) { return true; }
@@ -428,6 +433,7 @@ namespace llvm {
const SCEVHandle &Conc) const;
virtual void print(std::ostream &OS) const;
+ void print(std::ostream *OS) const { if (OS) print(*OS); }
/// Methods for support type inquiry through isa, cast, and dyn_cast:
static inline bool classof(const SCEVAddRecExpr *S) { return true; }
@@ -472,6 +478,7 @@ namespace llvm {
virtual const Type *getType() const;
virtual void print(std::ostream &OS) const;
+ void print(std::ostream *OS) const { if (OS) print(*OS); }
/// Methods for support type inquiry through isa, cast, and dyn_cast:
static inline bool classof(const SCEVUnknown *S) { return true; }
diff --git a/include/llvm/Analysis/Trace.h b/include/llvm/Analysis/Trace.h
index b26101d..65aa593c8 100644
--- a/include/llvm/Analysis/Trace.h
+++ b/include/llvm/Analysis/Trace.h
@@ -106,7 +106,8 @@ public:
/// print - Write trace to output stream.
///
- void print (OStream &O) const;
+ void print (std::ostream &O) const;
+ void print (std::ostream *O) const { if (O) print(*O); }
/// dump - Debugger convenience method; writes trace to standard error
/// output stream.