[clang] [StaticAnalyzer] Migrate away from PointerUnion::{is,get} (NFC) (PR #118421)

Balazs Benics via cfe-commits cfe-commits at lists.llvm.org
Mon Dec 2 23:17:23 PST 2024


================
@@ -222,23 +222,23 @@ void ExplodedNode::NodeGroup::addNode(ExplodedNode *N, ExplodedGraph &G) {
   GroupStorage &Storage = reinterpret_cast<GroupStorage&>(P);
   if (Storage.isNull()) {
     Storage = N;
-    assert(Storage.is<ExplodedNode *>());
+    assert(isa<ExplodedNode *>(Storage));
     return;
   }
 
   ExplodedNodeVector *V = Storage.dyn_cast<ExplodedNodeVector *>();
 
   if (!V) {
     // Switch from single-node to multi-node representation.
-    ExplodedNode *Old = Storage.get<ExplodedNode *>();
+    ExplodedNode *Old = cast<ExplodedNode *>(Storage);
----------------
steakhal wrote:

I think we can drop the type in the declaration because its already spelled on the line.

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


More information about the cfe-commits mailing list