[clang] [clang][tools] Handle weak (and duplicate) symbols in clang-extdef-mapping (PR #222010)
Arseniy Zaostrovnykh via cfe-commits
cfe-commits at lists.llvm.org
Wed Sep 9 04:49:09 PDT 2026
=?utf-8?q?Balázs_Kéri?= <balazs.keri at ericsson.com>
Message-ID:
In-Reply-To: <llvm.org/llvm/llvm-project/pull/222010 at github.com>
https://github.com/necto requested changes to this pull request.
I agree with the approach overall, but I am worried that the particular implementation might make the code less maintainable.
It will surprise me that `MapExtDefNamesConsumer` operate on a global shared state. At the same time I believe it is not much more complicated to keep state of each `MapExtDefNamesConsumer` private and ephemeral, and aggregate them into a local variable in `HandleFiles`. Alternatively, they can hold an explicit pointer to the shared collection local in `HandleFiles`.
Additionally, I think it would be useful to add a couple of tests demonstrating the following behaviors:
- does a symbol defined in another TU override a weak symbol in main TU?
- what happens when there are two strong symbols (unless there is already a "duplicate symbol" test, but I failed to find it after a quick look).
https://github.com/llvm/llvm-project/pull/222010
More information about the cfe-commits
mailing list