diff options
author | Misha Brukman <brukman+llvm@gmail.com> | 2004-04-28 19:22:58 +0000 |
---|---|---|
committer | Misha Brukman <brukman+llvm@gmail.com> | 2004-04-28 19:22:58 +0000 |
commit | df3d2e95a2606c607608252dd4069ae6feb14936 (patch) | |
tree | 2b311b0fe19b0d819b7f605d90be18435a8f1fe8 /include/llvm/Assembly | |
parent | 8618e52be514f1e4d20b0a49f8875ed3596522ed (diff) | |
download | external_llvm-df3d2e95a2606c607608252dd4069ae6feb14936.zip external_llvm-df3d2e95a2606c607608252dd4069ae6feb14936.tar.gz external_llvm-df3d2e95a2606c607608252dd4069ae6feb14936.tar.bz2 |
* Make contained ostream not public.
* Remove various print methods that called the Value* method, just have one that
all subclasses of Value will use anyway.
* Remove template for printing constant references
* Add methods to print char* and strings
* setStream now sets the stream on the contained AssemblyWriter
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13246 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Assembly')
-rw-r--r-- | include/llvm/Assembly/CachedWriter.h | 37 |
1 files changed, 11 insertions, 26 deletions
diff --git a/include/llvm/Assembly/CachedWriter.h b/include/llvm/Assembly/CachedWriter.h index 0808600..27193e7 100644 --- a/include/llvm/Assembly/CachedWriter.h +++ b/include/llvm/Assembly/CachedWriter.h @@ -31,15 +31,14 @@ class CachedWriter { AssemblyWriter *AW; SlotCalculator *SC; bool SymbolicTypes; -public: std::ostream *Out; +public: enum TypeWriter { SymTypeOn, SymTypeOff }; -public: CachedWriter(std::ostream &O = std::cout) : AW(0), SC(0), SymbolicTypes(false), Out(&O) { } CachedWriter(const Module *M, std::ostream &O = std::cout) @@ -53,27 +52,10 @@ public: CachedWriter &operator<<(const Value *V); - inline CachedWriter &operator<<(Value *X) { - return *this << (const Value*)X; - } - inline CachedWriter &operator<<(const GlobalVariable *X) { - return *this << (const Value*)X; - } - inline CachedWriter &operator<<(const Function *X) { - return *this << (const Value*)X; - } - inline CachedWriter &operator<<(const Argument *X) { - return *this << (const Value*)X; - } - inline CachedWriter &operator<<(const BasicBlock *X) { - return *this << (const Value*)X; - } - inline CachedWriter &operator<<(const Instruction *X) { - return *this << (const Value*)X; - } - inline CachedWriter &operator<<(const Constant *X) { - return *this << (const Value*)X; + inline CachedWriter &operator<<(const Value &X) { + return *this << &X; } + CachedWriter &operator<<(const Type *X); inline CachedWriter &operator<<(const PointerType *X); @@ -81,9 +63,12 @@ public: *Out << Manip; return *this; } - template<class X> - inline CachedWriter &operator<<(const X &v) { - *Out << v; + inline CachedWriter& operator<<(const char *X) { + *Out << X; + return *this; + } + inline CachedWriter& operator<<(const std::string &X) { + *Out << X; return *this; } @@ -93,7 +78,7 @@ public: } inline std::ostream& getStream() { return *Out; } - inline void setStream(std::ostream &os) { Out = &os; } + void setStream(std::ostream &os); }; } // End llvm namespace |