mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-13 20:32:21 +00:00
Okay, so this is a huge hack. Fixme later
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1171 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
461f02fc19
commit
5818a7162d
@ -18,6 +18,7 @@ class SlotCalculator;
|
|||||||
class CachedWriter {
|
class CachedWriter {
|
||||||
AssemblyWriter *AW;
|
AssemblyWriter *AW;
|
||||||
SlotCalculator *SC;
|
SlotCalculator *SC;
|
||||||
|
public:
|
||||||
ostream &Out;
|
ostream &Out;
|
||||||
public:
|
public:
|
||||||
CachedWriter(ostream &O = cout) : AW(0), SC(0), Out(O) { }
|
CachedWriter(ostream &O = cout) : AW(0), SC(0), Out(O) { }
|
||||||
@ -31,11 +32,42 @@ public:
|
|||||||
|
|
||||||
CachedWriter &operator<<(const Value *V);
|
CachedWriter &operator<<(const Value *V);
|
||||||
|
|
||||||
template<class X>
|
inline CachedWriter &operator<<(Value *X) {
|
||||||
inline CachedWriter &operator<<(X &v) {
|
return *this << (const Value*)X;
|
||||||
Out << v;
|
}
|
||||||
return *this;
|
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
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user