4 Commits

Author SHA1 Message Date
Florian Mayer
842f25a5fb
[NFC] [dataflow] generalize smart pointer caching (#133350)
This allows us to use it for classes that use other names than get /
value.
2025-03-28 17:51:30 -07:00
Florian Mayer
1cbcaa4580
[clang][dataflow] Add matcher for pointer-like types to be cached (#132314)
This is used e.g. for iterators.
2025-03-21 13:27:11 -04:00
Jan Voung
59a9a8f2ea
[clang][dataflow] Fix smart pointer accessor caching to handle aliases (#124964)
Check the canonical type in the matchers to handle aliases.
For example std::optional uses add_pointer_t<...>.
2025-01-30 09:50:21 -05:00
Jan Voung
54309b1c2f
[clang][dataflow] Add matchers for smart pointer accessors to be cached (#120102)
This is part 1 of caching for smart pointer accessors, building on top
of the CachedConstAccessorsLattice, which caches "normal" accessors.

Smart pointer accessors are a bit different in that they may:
- have aliases to access the same underlying data (but potentially
  returning slightly different types like `&` vs `*`). Within a
  "checked" sequence users may mix uses of the different aliases and the
  check should apply to any of the spellings.
- may have non-const overloads in addition to the const version, where
  the non-const doesn't actually modify the container

Part 2 will follow and add transfer functions utilities. It will also
add a user UncheckedOptionalAccessModel. We'd seen false positives when
nesting StatusOr<optional<T>> and optional<StatusOr<T>>, etc. which this
can help address.
2024-12-20 09:01:13 -05:00