[llvm-commits] CVS: llvm/include/llvm/Assembly/CachedWriter.h
Misha Brukman
brukman at cs.uiuc.edu
Wed Apr 28 14:23:01 PDT 2004
Changes in directory llvm/include/llvm/Assembly:
CachedWriter.h updated: 1.14 -> 1.15
---
Log message:
* 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
---
Diffs of the changes: (+11 -26)
Index: llvm/include/llvm/Assembly/CachedWriter.h
diff -u llvm/include/llvm/Assembly/CachedWriter.h:1.14 llvm/include/llvm/Assembly/CachedWriter.h:1.15
--- llvm/include/llvm/Assembly/CachedWriter.h:1.14 Wed Apr 28 10:30:33 2004
+++ llvm/include/llvm/Assembly/CachedWriter.h Wed Apr 28 14:22:58 2004
@@ -31,15 +31,14 @@
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 @@
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 @@
*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 @@
}
inline std::ostream& getStream() { return *Out; }
- inline void setStream(std::ostream &os) { Out = &os; }
+ void setStream(std::ostream &os);
};
} // End llvm namespace
More information about the llvm-commits
mailing list