summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2001-11-07 05:31:53 +0000
committerChris Lattner <sabre@nondot.org>2001-11-07 05:31:53 +0000
commit28e969d6892f06762a518371f81763e108762fd3 (patch)
tree5adda5b4939f896f4ccdebe1acbc242b425523eb
parenteaec4ede57c0aaeada50f40add21885b7ce34da4 (diff)
downloadbcm5719-llvm-28e969d6892f06762a518371f81763e108762fd3.tar.gz
bcm5719-llvm-28e969d6892f06762a518371f81763e108762fd3.zip
Okay, so this is a huge hack. Fixme later
llvm-svn: 1171
-rw-r--r--llvm/include/llvm/Assembly/CachedWriter.h40
1 files changed, 36 insertions, 4 deletions
diff --git a/llvm/include/llvm/Assembly/CachedWriter.h b/llvm/include/llvm/Assembly/CachedWriter.h
index ab6756abcb0..7996982de49 100644
--- a/llvm/include/llvm/Assembly/CachedWriter.h
+++ b/llvm/include/llvm/Assembly/CachedWriter.h
@@ -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
OpenPOWER on IntegriCloud