Support for llvm streams.

llvm-svn: 31982
This commit is contained in:
Bill Wendling 2006-11-28 22:45:17 +00:00
parent 228bcd3802
commit a60d8edfc9
2 changed files with 8 additions and 2 deletions

View File

@ -217,6 +217,9 @@ public:
/// the mapping in the LoopInfo class. /// the mapping in the LoopInfo class.
void removeBlockFromLoop(BasicBlock *BB); void removeBlockFromLoop(BasicBlock *BB);
void print(llvm_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;
void dump() const; void dump() const;
private: private:
@ -280,6 +283,9 @@ public:
virtual bool runOnFunction(Function &F); virtual bool runOnFunction(Function &F);
virtual void releaseMemory(); virtual void releaseMemory();
void print(llvm_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* = 0) const;
virtual void getAnalysisUsage(AnalysisUsage &AU) const; virtual void getAnalysisUsage(AnalysisUsage &AU) const;

View File

@ -18,11 +18,11 @@
#ifndef LLVM_ANALYSIS_TRACE_H #ifndef LLVM_ANALYSIS_TRACE_H
#define LLVM_ANALYSIS_TRACE_H #define LLVM_ANALYSIS_TRACE_H
#include <iosfwd>
#include <vector> #include <vector>
#include <cassert> #include <cassert>
namespace llvm { namespace llvm {
class llvm_ostream;
class BasicBlock; class BasicBlock;
class Function; class Function;
class Module; class Module;
@ -106,7 +106,7 @@ public:
/// print - Write trace to output stream. /// print - Write trace to output stream.
/// ///
void print (std::ostream &O) const; void print (llvm_ostream &O) const;
/// dump - Debugger convenience method; writes trace to standard error /// dump - Debugger convenience method; writes trace to standard error
/// output stream. /// output stream.