[clang] [analyzer][NFC] Rename LivenessValues::equals to LivenessValues::operator== (PR #157657)

via cfe-commits cfe-commits at lists.llvm.org
Tue Sep 9 05:11:50 PDT 2025


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-clang-static-analyzer-1

Author: Balazs Benics (steakhal)

<details>
<summary>Changes</summary>

This is just more conventional.

---
Full diff: https://github.com/llvm/llvm-project/pull/157657.diff


2 Files Affected:

- (modified) clang/include/clang/Analysis/Analyses/LiveVariables.h (+1-1) 
- (modified) clang/lib/Analysis/LiveVariables.cpp (+2-2) 


``````````diff
diff --git a/clang/include/clang/Analysis/Analyses/LiveVariables.h b/clang/include/clang/Analysis/Analyses/LiveVariables.h
index 8a3dd0c35e64c..480a63cbb8b32 100644
--- a/clang/include/clang/Analysis/Analyses/LiveVariables.h
+++ b/clang/include/clang/Analysis/Analyses/LiveVariables.h
@@ -34,7 +34,7 @@ class LiveVariables : public ManagedAnalysis {
     llvm::ImmutableSet<const VarDecl *> liveDecls;
     llvm::ImmutableSet<const BindingDecl *> liveBindings;
 
-    bool equals(const LivenessValues &V) const;
+    bool operator==(const LivenessValues &V) const;
 
     LivenessValues()
       : liveExprs(nullptr), liveDecls(nullptr), liveBindings(nullptr) {}
diff --git a/clang/lib/Analysis/LiveVariables.cpp b/clang/lib/Analysis/LiveVariables.cpp
index db88d4f7ee0f7..dee7fb275c8f3 100644
--- a/clang/lib/Analysis/LiveVariables.cpp
+++ b/clang/lib/Analysis/LiveVariables.cpp
@@ -127,7 +127,7 @@ LiveVariablesImpl::merge(LiveVariables::LivenessValues valsA,
                                        BSetRefA.asImmutableSet());
 }
 
-bool LiveVariables::LivenessValues::equals(const LivenessValues &V) const {
+bool LiveVariables::LivenessValues::operator==(const LivenessValues &V) const {
   return liveExprs == V.liveExprs && liveDecls == V.liveDecls &&
          liveBindings == V.liveBindings;
 }
@@ -598,7 +598,7 @@ LiveVariables::computeLiveness(AnalysisDeclContext &AC, bool killAtAssign) {
 
     if (!everAnalyzedBlock[block->getBlockID()])
       everAnalyzedBlock[block->getBlockID()] = true;
-    else if (prevVal.equals(val))
+    else if (prevVal == val)
       continue;
 
     prevVal = val;

``````````

</details>


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


More information about the cfe-commits mailing list