Use the DebugInfo's 'print()' method to emit the comments.
authorBill Wendling <isanbard@gmail.com>
Tue, 3 Jul 2012 20:01:02 +0000 (20:01 +0000)
committerBill Wendling <isanbard@gmail.com>
Tue, 3 Jul 2012 20:01:02 +0000 (20:01 +0000)
These give quite a bit more information about the DebugInfo and makes it more
readable.

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

lib/VMCore/AsmWriter.cpp

index 99e2687bbe283c39c322927962744739e394cb82..669d308b1a1c80cffce755365643fd5b9a077987 100644 (file)
@@ -2043,10 +2043,12 @@ static void WriteMDNodeComment(const MDNode *Node,
 
   unsigned Tag = Desc.getTag();
   Out.PadToColumn(50);
-  if (Tag == dwarf::DW_TAG_user_base)
+  if (dwarf::TagString(Tag)) {
+    Out << "; ";
+    Desc.print(Out);
+  } else if (Tag == dwarf::DW_TAG_user_base) {
     Out << "; [ DW_TAG_user_base ]";
-  else if (const char *TagName = dwarf::TagString(Tag))
-    Out << "; [ " << TagName << " ]";
+  }
 }
 
 void AssemblyWriter::writeAllMDNodes() {