aboutsummaryrefslogtreecommitdiffstats
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
commitb0e4523624fbe493a945ea73a8f3c6d6526f3f27 (patch)
tree30a813266985ae07c1901c122e52f90b2abea8d9
parentb2d22f6dce54560f0c3057ea29138ed87ba94158 (diff)
downloadexternal_llvm-b0e4523624fbe493a945ea73a8f3c6d6526f3f27.zip
external_llvm-b0e4523624fbe493a945ea73a8f3c6d6526f3f27.tar.gz
external_llvm-b0e4523624fbe493a945ea73a8f3c6d6526f3f27.tar.bz2
Add support for printing globals
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@537 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/VMCore/AsmWriter.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/VMCore/AsmWriter.cpp b/lib/VMCore/AsmWriter.cpp
index 9056865..926e611 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 << "<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);