[PATCH] D27995: Add the ability for DWARFDie objects to get the parent DWARFDie.

David Blaikie via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 20 14:02:56 PST 2016


dblaikie added inline comments.


================
Comment at: unittests/DebugInfo/DWARF/DWARFDebugInfoTest.cpp:985-999
+  CUDie.addAttribute(DW_AT_name, DW_FORM_strp, "/tmp/main.c");
+  CUDie.addAttribute(DW_AT_language, DW_FORM_data2, DW_LANG_C);
 
+  // Create a base type DIE in the compile unit
+  CUDie.addChild(DW_TAG_base_type);
+  
+  // Create a function DIE with two children in the compile unit
----------------
Again, I'd probably skip tags (or is there something in the DWARF parser that has trouble dealing with a CU with no attributes?) & use the same tag repeatedly (preferably a clearly bogus tag - if we have a DW_TAG_unknown or something, that'd be ideal) to make it clear that the semantics of tag relationships aren't what's being tested here.


================
Comment at: unittests/DebugInfo/DWARF/DWARFDebugInfoTest.cpp:1015
+  // DieDG.dump(llvm::outs(), U, UINT32_MAX);
+  
+  // The compile unit doesn't have a parent or a sibling.
----------------
The rest of this function appears to do too much testing - I doubt every relationship between every node in this tree pulls its weight in testing. Looks like they mostly test the same codepaths over and over again.

Could this be a bit more targeted? (test representative cases of interesting relationships - rather than every relationship)


https://reviews.llvm.org/D27995





More information about the llvm-commits mailing list