From adfe0d19d64367edef7461bfb7776255e3d12092 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Mon, 10 Sep 2001 20:08:19 +0000 Subject: [PATCH] Add support for printing globals llvm-svn: 537 --- llvm/lib/VMCore/AsmWriter.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/llvm/lib/VMCore/AsmWriter.cpp b/llvm/lib/VMCore/AsmWriter.cpp index 9056865849ac..926e61160c99 100644 --- a/llvm/lib/VMCore/AsmWriter.cpp +++ b/llvm/lib/VMCore/AsmWriter.cpp @@ -371,6 +371,13 @@ void WriteToAssembly(const Module *M, ostream &o) { W.write(M); } +void WriteToAssembly(const GlobalVariable *G, ostream &o) { + if (G == 0) { o << " global variable\n"; return; } + SlotCalculator SlotTable(G->getParent(), true); + AssemblyWriter W(o, SlotTable); + W.write(G); +} + void WriteToAssembly(const Method *M, ostream &o) { if (M == 0) { o << " method\n"; return; } SlotCalculator SlotTable(M->getParent(), true);