Don't discard an AssemblyAnnotationWriter when writing GlobalValues,
authorDan Gohman <gohman@apple.com>
Mon, 20 Apr 2009 16:10:33 +0000 (16:10 +0000)
committerDan Gohman <gohman@apple.com>
Mon, 20 Apr 2009 16:10:33 +0000 (16:10 +0000)
which include Functions, where it can be quite useful to use an
AssemblyAnnotationWriter.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69598 91177308-0d34-0410-b5e6-96231b3b80d8

lib/VMCore/AsmWriter.cpp

index e4dd9d6b83e17906a871b1be099f0e5cc6169213..f007c7645cc017dd1a2e775d5dc929be2ec4259e 100644 (file)
@@ -1833,7 +1833,7 @@ void Value::print(raw_ostream &OS, AssemblyAnnotationWriter *AAW) const {
     W.write(BB);
   } else if (const GlobalValue *GV = dyn_cast<GlobalValue>(this)) {
     SlotTracker SlotTable(GV->getParent());
-    AssemblyWriter W(OS, SlotTable, GV->getParent(), 0);
+    AssemblyWriter W(OS, SlotTable, GV->getParent(), AAW);
     W.write(GV);
   } else if (const Constant *C = dyn_cast<Constant>(this)) {
     TypePrinting TypePrinter;