[clang] [analyzer] Avoid redundant ProgramState refcounting and copies (PR #244848)

Gábor Horváth via cfe-commits cfe-commits at lists.llvm.org
Mon Nov 23 12:50:32 PST 2026


Xazax-hun wrote:

> What is the disadvantage of passing const ProgramState& types? Compared to what is proposed here?

For checker interface or for internal APIs? This PR keeps the checker interface to keep it small and to not break every downstream users. For internal APIs, it is passing pointers. I prefer pointers in this case because they have non-trivial lifetime constraints (they are refcounted and might outlive the caller/escape into data structures) as a stylistic choice. 

Performance-wise I do not expect any wins from changing the public checker API based on some small scale experiments that was done by Claude, so I'd argue we should not break it.

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


More information about the cfe-commits mailing list