From: Chris Lattner Date: Mon, 10 Sep 2001 20:08:19 +0000 (+0000) Subject: Add support for printing globals X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=b0e4523624fbe493a945ea73a8f3c6d6526f3f27;p=oota-llvm.git Add support for printing globals git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@537 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/VMCore/AsmWriter.cpp b/lib/VMCore/AsmWriter.cpp index 9056865849a..926e61160c9 100644 --- a/lib/VMCore/AsmWriter.cpp +++ b/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);