[PATCH] D133047: [DWARFLinker] Refactor clang modules loading code.

Alexey Lapshin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 31 13:29:49 PDT 2022


avl created this revision.
avl added reviewers: aprantl, JDevlieghere, clayborg.
Herald added a subscriber: hiraditya.
Herald added a project: All.
avl requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Current implementation of registerModuleReference() function not only
"registers" module reference, but also clones referenced module
(inside loadClangModule()). That may lead to cloning the module with
incorrect options (registerModuleReference() examines module references
and additionally accumulates MaxDwarfVersion and accel tables info).
Since accumulated options may differ from the current values,
it is incorrect to clone modules before options are fully accumulated.

This patch separates "cloning" code from "registering" code. So,
that accumulating option is done in the "registering stage" and
"cloning" is done after all modules are registered and options accumulated.
It also adds a callback for loaded compile units which can be used for
D132755 <https://reviews.llvm.org/D132755> and D132371 <https://reviews.llvm.org/D132371>(to allow doing options accumulation outside
of DWARFLinker).


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D133047

Files:
  llvm/include/llvm/DWARFLinker/DWARFLinker.h
  llvm/lib/DWARFLinker/DWARFLinker.cpp
  llvm/tools/dsymutil/DwarfLinkerForBinary.cpp
  llvm/tools/llvm-dwarfutil/DebugInfoLinker.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D133047.457076.patch
Type: text/x-patch
Size: 27466 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220831/6916ea55/attachment.bin>


More information about the llvm-commits mailing list