This patch implements the name lookup functionality of the .debug_names
accelerator table and hooks it up to "llvm-dwarfdump -find". To make the
interface of the two kinds of accelerator tables more consistent, I've
created an abstract "DWARFAcceleratorTable::Entry" class, which provides
a consistent interface to access the common functionality of the table
entries (such as getting the die offset, die tag, etc.). I've also
modified the apple table to vend entries conforming to this interface.
Details
Diff Detail
- Repository
- rL LLVM
- Build Status
Buildable 14762 Build 14762: arc lint + arc unit
Event Timeline
tools/llvm-dwarfdump/llvm-dwarfdump.cpp | ||
---|---|---|
370 | Technically, this changes behavior for apple tables as previously it would accept any section offset here, but I think the author was looking for the DIE offset here anyway. |
include/llvm/DebugInfo/DWARF/DWARFAcceleratorTable.h | ||
---|---|---|
290–295 | These ones are a bit tricky. They could be made default, but then I'd have to un-delete the super class implementations (which I deleted as a standard precaution for polymorphic classes). Maybe I could make the super class functions protected to make sure they're not invoked accidentally ? (The reason I need these constructors in the first place is so I can return the object as a value from the parsing function without resorting to unique_ptrs and such. I did feel it a bit weird while doing it as this isn't standard practice for polymorphic classes, but it seemed like a nice optimization.) |
Make the base class copy/move operations protected and remote the hand-coded implementations from the derived class.
Also, if possible - the Entry dtor could be made non-virtual and protected in the base class, if these objects are never owned polymorphically, which it /looks/ like they aren't, but not entirely sure.
Make base Entry destructor protected and nonvirtual (the class is not owned polymorphically right now).
Will commit once issues with the djb hash function are resolved.
default