[Lldb-commits] [PATCH] D73206: Pass `CompileUnit *` along `DWARFDIE` for DWZ

Jan Kratochvil via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Fri Apr 24 05:54:24 PDT 2020


jankratochvil added a comment.

@labath now with existing callbacks

  llvm::function_ref<bool(DWARFDIE die)> callback

I am going to add `DWARFCompileUnit *main_unit` somewhere. BTW it can be `nullptr`, for example for DIES from type units. In my WIP patches I was putting it in front (as `main_unit` sort of contains the `die`):

  llvm::function_ref<bool(DWARFCompileUnit *main_unit, DWARFDIE die)> callback

or do you prefer it added at the end?

  llvm::function_ref<bool(DWARFDIE die, DWARFCompileUnit *main_unit)> callback

This applies also to API like:

  clang::BlockDecl *DWARFASTParserClang::ResolveBlockDIE(DWARFCompileUnit *main_unit, const DWARFDIE &die) {

vs..

  clang::BlockDecl *DWARFASTParserClang::ResolveBlockDIE(const DWARFDIE &die, DWARFCompileUnit *main_unit) {

I want to prevent using default parameters:

  clang::BlockDecl *DWARFASTParserClang::ResolveBlockDIE(const DWARFDIE &die, DWARFCompileUnit *main_unit = nullptr) {

as that would easily lead to forgetting to delegate `main_unit` which would only be discovered during DWZ tests (and only if they test such specific API function).


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D73206/new/

https://reviews.llvm.org/D73206





More information about the lldb-commits mailing list