[PATCH] D74923: [DebugInfo]: Do not start parsing macinfo/macinfo.dwo if the section's are empty.

Sourabh Singh Tomar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 20 12:20:33 PST 2020


SouraVX created this revision.
SouraVX added reviewers: probinson, aprantl, jini.susan.george, dblaikie.
SouraVX added a project: debug-info.
Herald added subscribers: llvm-commits, hiraditya.
Herald added a project: LLVM.

We're unnecessarily parsing and dumping macinfo/dwo section contents, even when sections are empty.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D74923

Files:
  llvm/lib/DebugInfo/DWARF/DWARFContext.cpp


Index: llvm/lib/DebugInfo/DWARF/DWARFContext.cpp
===================================================================
--- llvm/lib/DebugInfo/DWARF/DWARFContext.cpp
+++ llvm/lib/DebugInfo/DWARF/DWARFContext.cpp
@@ -442,12 +442,14 @@
 
   if (shouldDump(Explicit, ".debug_macinfo", DIDT_ID_DebugMacro,
                  DObj->getMacinfoSection())) {
-    getDebugMacro()->dump(OS);
+    if (!DObj->getMacinfoSection().empty())
+      getDebugMacro()->dump(OS);
   }
 
   if (shouldDump(Explicit, ".debug_macinfo.dwo", DIDT_ID_DebugMacro,
                  DObj->getMacinfoDWOSection())) {
-    getDebugMacroDWO()->dump(OS);
+    if (!DObj->getMacinfoDWOSection().empty())
+      getDebugMacroDWO()->dump(OS);
   }
 
   if (shouldDump(Explicit, ".debug_aranges", DIDT_ID_DebugAranges,


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D74923.245716.patch
Type: text/x-patch
Size: 781 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200220/a96d5154/attachment.bin>


More information about the llvm-commits mailing list