diff --git a/llvm/include/llvm/DebugInfo/DWARF/DWARFTypePrinter.h b/llvm/include/llvm/DebugInfo/DWARF/DWARFTypePrinter.h --- a/llvm/include/llvm/DebugInfo/DWARF/DWARFTypePrinter.h +++ b/llvm/include/llvm/DebugInfo/DWARF/DWARFTypePrinter.h @@ -9,11 +9,14 @@ #ifndef LLVM_DEBUGINFO_DWARF_DWARFTYPEPRINTER_H #define LLVM_DEBUGINFO_DWARF_DWARFTYPEPRINTER_H +#include "llvm/ADT/SmallSet.h" #include "llvm/ADT/StringRef.h" #include "llvm/BinaryFormat/Dwarf.h" #include "llvm/DebugInfo/DWARF/DWARFDie.h" +#include #include +#include namespace llvm { @@ -25,6 +28,7 @@ raw_ostream &OS; bool Word = true; bool EndedWithTemplate = false; + std::unordered_set ScopelessDIEs = {dwarf::DW_TAG_pointer_type}; DWARFTypePrinter(raw_ostream &OS) : OS(OS) {} diff --git a/llvm/lib/DebugInfo/DWARF/DWARFTypePrinter.cpp b/llvm/lib/DebugInfo/DWARF/DWARFTypePrinter.cpp --- a/llvm/lib/DebugInfo/DWARF/DWARFTypePrinter.cpp +++ b/llvm/lib/DebugInfo/DWARF/DWARFTypePrinter.cpp @@ -283,8 +283,9 @@ } void DWARFTypePrinter::appendQualifiedName(DWARFDie D) { - if (D) + if (D && !ScopelessDIEs.count(D.getTag())) appendScopes(D.getParent()); + appendUnqualifiedName(D); } DWARFDie DWARFTypePrinter::appendQualifiedNameBefore(DWARFDie D) {