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

Greg Clayton via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 20 15:53:18 PST 2016


clayborg added a comment.

I am not sure I would want to trim much more. Let me know if you see things I can trim. I could remove the "C2" die, but that is about it. Let me know if you see other stuff that can be trimmed.



================
Comment at: unittests/DebugInfo/DWARF/DWARFDebugInfoTest.cpp:992
+    C2
+  };
 
----------------
The blocks you build with (classes in llvm/CodeGen) are different from the blocks that are in the DWARF parser API (llvm/DebugInfo/DWARF) so it really isn't practical to try and just create DIE objects since that isn't what our parser is using. So the only way to currently use the API is to actually encode bytes so we can decode them and use the DWARF parsing API.


================
Comment at: unittests/DebugInfo/DWARF/DWARFDebugInfoTest.cpp:1103
+  EXPECT_EQ(C1.getParent().getOffset(), C.getOffset());
+  EXPECT_EQ(C2.getParent().getOffset(), C.getOffset());
+  
----------------
I believe this is close to the bare bones as we can get it. We are testing two DIEs, B and C that have children and making sure all functions get the right children and siblings. I can cut out the whole C tree, but then that won't test asking B2 to get its sibling and making sure we don't return C1 as its sibling... What would you cut from this? I can cut the B2 and C2, bit would rather not, as I want two consecutive DIEs with no children as a test.


================
Comment at: unittests/DebugInfo/DWARF/DWARFDebugInfoTest.cpp:1110
+  EXPECT_FALSE(DefaultDie.getFirstChild().isValid());
+  EXPECT_FALSE(DefaultDie.getSibling().isValid());
+}
----------------
I can remove it,


https://reviews.llvm.org/D27995





More information about the llvm-commits mailing list