Okay, so this is a huge hack. Fixme later
authorChris Lattner <sabre@nondot.org>
Wed, 7 Nov 2001 05:31:53 +0000 (05:31 +0000)
committerChris Lattner <sabre@nondot.org>
Wed, 7 Nov 2001 05:31:53 +0000 (05:31 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1171 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Assembly/CachedWriter.h

index ab6756abcb0a5d7dc49b9f58d3b17b45f3438dfd..7996982de49a6ade5694116e63e5f58294edd7e1 100644 (file)
@@ -18,6 +18,7 @@ class SlotCalculator;
 class CachedWriter {
   AssemblyWriter *AW;
   SlotCalculator *SC;
+public:
   ostream &Out;
 public:
   CachedWriter(ostream &O = cout) : AW(0), SC(0), Out(O) { }
@@ -31,11 +32,42 @@ public:
 
   CachedWriter &operator<<(const Value *V);
 
-  template<class X>
-  inline CachedWriter &operator<<(X &v) {
-    Out << v;
-    return *this;
+  inline CachedWriter &operator<<(Value *X) {
+    return *this << (const Value*)X;
+  }
+  inline CachedWriter &operator<<(const Module *X) {
+    return *this << (const Value*)X;
+  }
+  inline CachedWriter &operator<<(const GlobalVariable *X) {
+    return *this << (const Value*)X;
+  }
+  inline CachedWriter &operator<<(const Method *X) {
+    return *this << (const Value*)X;
+  }
+  inline CachedWriter &operator<<(const MethodArgument *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 ConstPoolVal *X) {
+    return *this << (const Value*)X; 
+  }
+  inline CachedWriter &operator<<(const Type *X) {
+    return *this << (const Value*)X;
+  }
+  inline CachedWriter &operator<<(const PointerType *X) {
+    return *this << (const Value*)X; 
   }
 };
 
+template<class X>
+inline CachedWriter &operator<<(CachedWriter &CW, const X &v) {
+  CW.Out << v;
+  return CW;
+}
+
 #endif