[clang] 4461de2 - [StaticAnalyzer] Remove unnecessary casts (NFC) (#146706)

via cfe-commits cfe-commits at lists.llvm.org
Wed Jul 2 09:32:19 PDT 2025


Author: Kazu Hirata
Date: 2025-07-02T09:32:15-07:00
New Revision: 4461de2e5139932a1ae73bf686c63c0f6aa44a7a

URL: https://github.com/llvm/llvm-project/commit/4461de2e5139932a1ae73bf686c63c0f6aa44a7a
DIFF: https://github.com/llvm/llvm-project/commit/4461de2e5139932a1ae73bf686c63c0f6aa44a7a.diff

LOG: [StaticAnalyzer] Remove unnecessary casts (NFC) (#146706)

N is already of ExplodedNode *.

Added: 
    

Modified: 
    clang/include/clang/StaticAnalyzer/Core/PathSensitive/ExplodedGraph.h

Removed: 
    


################################################################################
diff  --git a/clang/include/clang/StaticAnalyzer/Core/PathSensitive/ExplodedGraph.h b/clang/include/clang/StaticAnalyzer/Core/PathSensitive/ExplodedGraph.h
index e995151927c96..bd11e0d40cfa9 100644
--- a/clang/include/clang/StaticAnalyzer/Core/PathSensitive/ExplodedGraph.h
+++ b/clang/include/clang/StaticAnalyzer/Core/PathSensitive/ExplodedGraph.h
@@ -448,14 +448,15 @@ class ExplodedNodeSet {
 
 public:
   ExplodedNodeSet(ExplodedNode *N) {
-    assert(N && !static_cast<ExplodedNode*>(N)->isSink());
+    assert(N && !N->isSink());
     Impl.insert(N);
   }
 
   ExplodedNodeSet() = default;
 
   void Add(ExplodedNode *N) {
-    if (N && !static_cast<ExplodedNode*>(N)->isSink()) Impl.insert(N);
+    if (N && !N->isSink())
+      Impl.insert(N);
   }
 
   using iterator = ImplTy::iterator;


        


More information about the cfe-commits mailing list