[PATCH] D27170: Abstract almost all DwarfDebug out of the classes in DIE.cpp.

Greg Clayton via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 30 13:00:53 PST 2016


clayborg added a comment.

Commented inline on the DW_FORM_ref_addr vs DW_FORM_ref4 question.



================
Comment at: lib/CodeGen/AsmPrinter/DwarfUnit.cpp:303
   Die.addValue(DIEValueAllocator, Attribute,
-               EntryCU == DieCU ? dwarf::DW_FORM_ref4 : dwarf::DW_FORM_ref_addr,
+               EntryCU == CU ? dwarf::DW_FORM_ref4 : dwarf::DW_FORM_ref_addr,
                Entry);
----------------
There should be no size difference at all DW_FORM_ref_addr are 4 bytes in DWARF32 unless you are emitting Version 2, which we don't emit much right? There is a computation penalty for using DW_FORM_ref_addr since and attribute in a DIE will have a DIEValue that contains a DIEEntry. DIEEntry objects point to DIE objects and these have CU relative offsets stored inside of them, so in order to emit a DW_FORM_ref_addr, we will need to get the Unit DIE and then than add the compile/type unit's absolute offset to the DIE's offset to compute the absolute offset, so there will be some performance cost to using DW_FORM_ref_addr.


https://reviews.llvm.org/D27170





More information about the llvm-commits mailing list