[clang] [APINotes] Diagnose invalid Where.Parameters selectors (PR #209408)

via cfe-commits cfe-commits at lists.llvm.org
Fri Jul 24 09:24:59 PDT 2026


StoeckOverflow wrote:

Thanks for the review! I updated this patch to address the feedback:

- promoted `FunctionTableKey` into shared API-notes types and made `APINotesFunctionSelectorKey` wrap it, so the selector-key fields are not duplicated
- switched the reverse identifier cache to a `DenseMap` because identifier IDs are not guaranteed to be visited densely or in increasing order
- encapsulated selector diagnostic tracking in `APINotesSelectorDiagnosticState` and `APINotesSelectorDiagnosticReaderState`, with comments documenting how exact selectors are marked used and diagnosed at end of the TU
- removed the extra `Initialized` bit by using `try_emplace`
- removed the now-trivial `toAPINotesFunctionSelectorKey` helper
- improved duplicate-selector diagnostic wording
- converted the duplicate-selector fixture to `split-file`, so the YAML entries and `CHECK` lines are colocated

https://github.com/llvm/llvm-project/pull/209408


More information about the cfe-commits mailing list