#
72a28a3b |
| 08-Jan-2025 |
Jan Voung <jvoung@google.com> |
[clang][dataflow] Use smart pointer caching in unchecked optional accessor (#120249)
Part 2 (and final part) following
https://github.com/llvm/llvm-project/pull/120102
Allows users to do things li
[clang][dataflow] Use smart pointer caching in unchecked optional accessor (#120249)
Part 2 (and final part) following
https://github.com/llvm/llvm-project/pull/120102
Allows users to do things like:
```
if (o->x.has_value()) {
((*o).x).value();
}
```
where the `->` and `*` are operator overload calls.
A user could instead extract the nested optional into a local variable
once instead of doing two accessor calls back to back, but currently
they are unsure why the code is flagged.
show more ...
|
#
87dd5dc8 |
| 16-Oct-2024 |
Jan Voung <jvoung@google.com> |
[clang][dataflow] Add a lattice to help cache const accessor methods (#111006)
By caching const accessor methods we can sometimes treat method call
results as stable (e.g., for issue
https://githu
[clang][dataflow] Add a lattice to help cache const accessor methods (#111006)
By caching const accessor methods we can sometimes treat method call
results as stable (e.g., for issue
https://github.com/llvm/llvm-project/issues/58510). Users can clear the
cache when a non-const method is called that may modify the state of an
object.
This is represented as mixin.
It will be used in a follow on patch to change
bugprone-unchecked-optional-access's lattice from NoopLattice to
CachedConstAccessorsLattice<NoopLattice>, along with some additional
transfer functions.
show more ...
|