llvm-project
ea23ef99 - [NFC][analyzer] Tweak constness of CheckerContext methods (#218937)

Commit
15 days ago
[NFC][analyzer] Tweak constness of CheckerContext methods (#218937) The method `CheckerContext::isDifferent` should be a `const` method (it does not modify `*this`), but it was originally declared as non-`const` and later commit f93f6e5259e32a00921c66561f3117356a779a01 introduced the `const` variant as an overload along the non-`const` original variant. As the non-`const` overload is does not have any advantage, this commit removes it. (In many other cases a separate non-`const` overload is needed because the `const` overload has `const` in its return type, but here both overloads return the same `bool`.) Additionally `CheckerContext::getPredecessor` had two overloads with signatures ```c++ ExplodedNode *getPredecessor() { return Pred; } const ExplodedNode *getPredecessor() const { return Pred; } ``` and this commit corrects it to `ExplodedNode *getPredecessor() const` because it can return a pointer to a non-`const` `ExplodedNode` even if `*this` is `const`.
Author
Parents
Loading