1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 19:42:54 +02:00

* Add capability of printing out a global variable

llvm-svn: 534
This commit is contained in:
Chris Lattner 2001-09-10 20:06:47 +00:00
parent d6023649c7
commit f38c10222e

View File

@ -20,6 +20,7 @@
#include "llvm/Type.h"
class Module;
class GlobalVariable;
class Method;
class BasicBlock;
class Instruction;
@ -30,6 +31,7 @@ class SlotCalculator;
// understand later... (the parser only understands whole classes though)
//
void WriteToAssembly(const Module *Module, ostream &o);
void WriteToAssembly(const GlobalVariable *G, ostream &o);
void WriteToAssembly(const Method *Method, ostream &o);
void WriteToAssembly(const BasicBlock *BB, ostream &o);
void WriteToAssembly(const Instruction *In, ostream &o);
@ -61,6 +63,10 @@ inline ostream &operator<<(ostream &o, const Module *C) {
WriteToAssembly(C, o); return o;
}
inline ostream &operator<<(ostream &o, const GlobalVariable *G) {
WriteToAssembly(G, o); return o;
}
inline ostream &operator<<(ostream &o, const Method *M) {
WriteToAssembly(M, o); return o;
}
@ -91,6 +97,7 @@ inline ostream &operator<<(ostream &o, const Value *I) {
case Value::InstructionVal: WriteToAssembly((const Instruction *)I, o); break;
case Value::BasicBlockVal: WriteToAssembly((const BasicBlock *)I, o); break;
case Value::MethodVal: WriteToAssembly((const Method *)I, o); break;
case Value::GlobalVal: WriteToAssembly((const GlobalVariable*)I,o);break;
case Value::ModuleVal: WriteToAssembly((const Module *)I, o); break;
default: return o << "<unknown value type: " << I->getValueType() << ">";
}