baloghadamsoftware added a comment.

In D65382#1605572 <https://reviews.llvm.org/D65382#1605572>, @NoQ wrote:

> It's counter-idiomatic to pass manager objects (`ProgramStateManager`, 
> `SValBuilder`, etc.) as const-references because it tells you pretty much 
> nothing about what you can or cannot do with them. You don't really ever 
> semantically mutate them in the first place. There's no need to mention it 
> every time you pass them around.


Most managers are stateful because they also store the elements they manage 
(e.g. `ProgramStateManager` stores states, `SValBuilder` owns other managers 
such as `SymbolManager` that stores symbols etc.) It is also true that 
`BugReporter` should not change the existing set of states, symbols etc., just 
use them in a read-only way. However, I see more confusion than help in making 
them const here and non-const elsewhere.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D65382/new/

https://reviews.llvm.org/D65382



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to