[llvm] 96bbf47 - [dsymutil] Add DW_TAG_common_block to dieNeedsChildrenToBeMeaningful

Jonas Devlieghere via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 1 10:49:51 PDT 2019


Author: Jonas Devlieghere
Date: 2019-11-01T10:49:07-07:00
New Revision: 96bbf478b6718b13b19ac52fd790e64d4ed56fe9

URL: https://github.com/llvm/llvm-project/commit/96bbf478b6718b13b19ac52fd790e64d4ed56fe9
DIFF: https://github.com/llvm/llvm-project/commit/96bbf478b6718b13b19ac52fd790e64d4ed56fe9.diff

LOG: [dsymutil] Add DW_TAG_common_block to dieNeedsChildrenToBeMeaningful

Ensure we walk the children of common blocks when deciding what DIEs to
keep. Otherwise we might incorrectly discard them leading to missing
variables in the linked debug info.

This also sorts the list of DW_TAGs alphabetically.

Added: 
    

Modified: 
    llvm/tools/dsymutil/DwarfLinker.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/tools/dsymutil/DwarfLinker.cpp b/llvm/tools/dsymutil/DwarfLinker.cpp
index 3313f6a1539e..e835ce19812b 100644
--- a/llvm/tools/dsymutil/DwarfLinker.cpp
+++ b/llvm/tools/dsymutil/DwarfLinker.cpp
@@ -359,11 +359,12 @@ static bool dieNeedsChildrenToBeMeaningful(uint32_t Tag) {
   switch (Tag) {
   default:
     return false;
-  case dwarf::DW_TAG_subprogram:
+  case dwarf::DW_TAG_class_type:
+  case dwarf::DW_TAG_common_block:
   case dwarf::DW_TAG_lexical_block:
-  case dwarf::DW_TAG_subroutine_type:
   case dwarf::DW_TAG_structure_type:
-  case dwarf::DW_TAG_class_type:
+  case dwarf::DW_TAG_subprogram:
+  case dwarf::DW_TAG_subroutine_type:
   case dwarf::DW_TAG_union_type:
     return true;
   }


        


More information about the llvm-commits mailing list