This post is not about unifying lldb DWARF DIE types with llvm DWARF DIE types, which has a much larger scope. Maybe this work could be the first step toward unifying these two types in the future.
IMO so long as the class is in LLDB and especially if there’s a mirror class on the LLVM side, being able to see that you’re working on one side or the other by naming convention is useful. But I don’t actively work on the lldb DWARF parser, so I’ll defer to folks who are more engaged on that side of lldb.
I don’t have strong feelings or investment here, but perhaps some options to consider:
Add the necessary LLVM API names to the LLDB API
Add all LLVM API names that can be added/are workable to the LLDB API
Encourage or discourage use of the LLVM API names in the LLDB usage
Remove the LLDB API names that are covered by LLVM API names
I think it’ll be tricky to have both naming conventions in the one class, especially if they’re required (if we add some LLVM API names and remove the equivalent lldb ones). So I /think/ the better spots here are either:
Adding the LLVM API names (some or all, probably just some/the needed ones) and keeping the LLDB names too, and discouraging the LLVM API name use for now, except in generic code like the motivating DWARFTypePrinter use
or
Changing all the names in the relevant types over to the LLVM API names, including updating all usage inside LLDB (through a series of patches - add the LLVM API, deprecate the LLDB name, migrate the callers, etc)
That’s my rough guess, at least? And that probably looks like doing the former rather than the latter is the right balance at the moment, but perhaps other folks feel differently.
Are there other points on the spectrum folks think are valid intermediate landing points? (even renaming everything is still an intermediate point - to the ultimate goal of LLDB’s DWARFDie/etc API sinking down into/merging with LLVM’s fully)
Do you have a list of functions that would be touched by this?
If the list is something like “all the DIE tree traversal methods and ~nothing else”, then I think we could just remove the LLDB functions in favour of the llvm names (I don’t think we need getParent and GetParent). If the list is more ad-hoc, then we may need to do something like what David suggested.
It’s more than just DIE tree traversal methods. The list is very ad-hoc.
I’m in favor of this approach:
Adding the LLVM API names (some or all, probably just some/the needed ones) and keeping the LLDB names too, and discouraging the LLVM API name use for now, except in generic code like the motivating DWARFTypePrinter use