[clang] [NFC][analyzer] Tweak constness of CheckerContext methods (PR #218937)

Arseniy Zaostrovnykh via cfe-commits cfe-commits at lists.llvm.org
Wed Aug 26 07:58:10 PDT 2026


=?utf-8?q?DonĂ¡t?= Nagy <donat.nagy at ericsson.com>
Message-ID:
In-Reply-To: <llvm.org/llvm/llvm-project/pull/218937 at github.com>


================
@@ -76,14 +76,12 @@ class CheckerContext {
   /// Returns the previous node in the exploded graph, which includes
   /// the state of the program before the checker ran. Note, checkers should
   /// not retain the node in their state since the nodes might get invalidated.
-  ExplodedNode *getPredecessor() { return Pred; }
-  const ExplodedNode *getPredecessor() const { return Pred; }
+  ExplodedNode *getPredecessor() const { return Pred; }
----------------
necto wrote:

I'm not sure about this one: I fear it might lead to more `const_cast`s as you are now removing the possibility to get a const `Pred`.

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


More information about the cfe-commits mailing list