[PATCH] D117134: [DebugInfo][DWARF][NFC] Move DWARFTypePrinter class to its own file.

Alexey Lapshin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 13 13:05:15 PST 2022


avl updated this revision to Diff 399758.
avl added a comment.

addressed comments(left DWARFTypePrinter inside DWARFDie.cpp, created two functions for type printing)


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D117134/new/

https://reviews.llvm.org/D117134

Files:
  llvm/include/llvm/DebugInfo/DWARF/DWARFDie.h
  llvm/lib/DebugInfo/DWARF/DWARFDie.cpp


Index: llvm/lib/DebugInfo/DWARF/DWARFDie.cpp
===================================================================
--- llvm/lib/DebugInfo/DWARF/DWARFDie.cpp
+++ llvm/lib/DebugInfo/DWARF/DWARFDie.cpp
@@ -772,7 +772,7 @@
     DWARFDie D = resolveReferencedType(Die, FormValue);
     if (D && !D.isNULL()) {
       OS << Space << "\"";
-      DWARFTypePrinter(OS).appendQualifiedName(D);
+      dumpTypeQualifiedName(D, OS);
       OS << '"';
     }
   } else if (Attr == DW_AT_APPLE_property_attribute) {
@@ -808,7 +808,7 @@
     return;
   if (getTag() == DW_TAG_GNU_template_parameter_pack)
     return;
-  DWARFTypePrinter(OS).appendUnqualifiedName(*this, OriginalFullName);
+  dumpTypeUnqualifiedName(*this, OS, OriginalFullName);
 }
 
 bool DWARFDie::isSubprogramDIE() const { return getTag() == DW_TAG_subprogram; }
@@ -1270,3 +1270,16 @@
     return false;
   }
 }
+
+namespace llvm {
+
+void dumpTypeQualifiedName(const DWARFDie &DIE, raw_ostream &OS) {
+  DWARFTypePrinter(OS).appendQualifiedName(DIE);
+}
+
+void dumpTypeUnqualifiedName(const DWARFDie &DIE, raw_ostream &OS,
+                             std::string *OriginalFullName) {
+  DWARFTypePrinter(OS).appendUnqualifiedName(DIE, OriginalFullName);
+}
+
+} // namespace llvm
Index: llvm/include/llvm/DebugInfo/DWARF/DWARFDie.h
===================================================================
--- llvm/include/llvm/DebugInfo/DWARF/DWARFDie.h
+++ llvm/include/llvm/DebugInfo/DWARF/DWARFDie.h
@@ -470,6 +470,10 @@
   return std::make_reverse_iterator(begin());
 }
 
+void dumpTypeQualifiedName(const DWARFDie &DIE, raw_ostream &OS);
+void dumpTypeUnqualifiedName(const DWARFDie &DIE, raw_ostream &OS,
+                             std::string *OriginalFullName = nullptr);
+
 } // end namespace llvm
 
 #endif // LLVM_DEBUGINFO_DWARF_DWARFDIE_H


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D117134.399758.patch
Type: text/x-patch
Size: 1810 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220113/9405f012/attachment.bin>


More information about the llvm-commits mailing list