summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2001-09-10 20:08:19 +0000
committerChris Lattner <sabre@nondot.org>2001-09-10 20:08:19 +0000
commitadfe0d19d64367edef7461bfb7776255e3d12092 (patch)
tree622d39afc3d34b9e837ce287f75edb4b01cb8e20
parent8ad45e8101150ad115b27b7294c6df6920b70a8d (diff)
downloadbcm5719-llvm-adfe0d19d64367edef7461bfb7776255e3d12092.tar.gz
bcm5719-llvm-adfe0d19d64367edef7461bfb7776255e3d12092.zip
Add support for printing globals
llvm-svn: 537
-rw-r--r--llvm/lib/VMCore/AsmWriter.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/lib/VMCore/AsmWriter.cpp b/llvm/lib/VMCore/AsmWriter.cpp
index 9056865849a..926e61160c9 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 << "<null> 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 << "<null> method\n"; return; }
SlotCalculator SlotTable(M->getParent(), true);
OpenPOWER on IntegriCloud