[clang] [llvm] [analyzer] Implemented a base of detecing lifetimebound annotation (PR #200145)

Benedek Kaibas via cfe-commits cfe-commits at lists.llvm.org
Tue Jun 9 05:30:34 PDT 2026


benedekaibas wrote:

Commit d91f1e5568bfaf3bdf7eff3416d5d45f3829545f resolves the following commentes:
- [Comment 1](https://github.com/llvm/llvm-project/pull/200145#discussion_r3371863372)
- [Comment 2](https://github.com/llvm/llvm-project/pull/200145#discussion_r3371887984)
- [Comment 3](https://github.com/llvm/llvm-project/pull/200145#discussion_r3371926613)
- [Comment 4](https://github.com/llvm/llvm-project/pull/200145#discussion_r3371931207)

Other changes:

I have changed the program state map to set. The problem I have faced when solving: https://github.com/llvm/llvm-project/pull/200145#discussion_r3330746906 was that just using a range based loop to iterate over the annotated parameters and store them in the state when the loop reached the second parameter the `set` method on the state overwrote the first annotated parameter. With the set storing (`SymbolRef`, `MemRegion *`) pairs each annotated parameter now has its own entry and all the bindings are preserved. I have only changed the map that was responsible for `SymbolRefs`, but for consistency the other map should be rewritten as well. 

I have looked at `MallocChecker` and the `InnerPointerChecker` to see how they work in similar cases. 

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


More information about the cfe-commits mailing list