diff options
author | Chris Lattner <sabre@nondot.org> | 2001-09-10 20:06:47 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2001-09-10 20:06:47 +0000 |
commit | 74f4a766c4810fe2b451a173e34e8a47dedc04bd (patch) | |
tree | 0b057cbb81f1c881ef650cf37e2e3493f32bdda5 /include/llvm/Assembly | |
parent | be07811cd0469e55ceecbe413639acaef49ceefd (diff) | |
download | llvm-74f4a766c4810fe2b451a173e34e8a47dedc04bd.tar.gz llvm-74f4a766c4810fe2b451a173e34e8a47dedc04bd.tar.bz2 llvm-74f4a766c4810fe2b451a173e34e8a47dedc04bd.tar.xz |
* Add capability of printing out a global variable
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@534 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Assembly')
-rw-r--r-- | include/llvm/Assembly/Writer.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/include/llvm/Assembly/Writer.h b/include/llvm/Assembly/Writer.h index f883312966..6c7f8e73a8 100644 --- a/include/llvm/Assembly/Writer.h +++ b/include/llvm/Assembly/Writer.h @@ -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() << ">"; } |