Skip to content

Conversation

@steakhal
Copy link
Contributor

@steakhal steakhal commented Sep 9, 2025

This is just more conventional.

@llvmbot llvmbot added clang Clang issues not falling into any other category clang:analysis labels Sep 9, 2025
@llvmbot
Copy link
Member

llvmbot commented Sep 9, 2025

@llvm/pr-subscribers-clang-analysis
@llvm/pr-subscribers-clang

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

Author: Balazs Benics (steakhal)

Changes

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 --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;

@steakhal steakhal merged commit 2194d6d into llvm:main Sep 9, 2025
13 checks passed
@steakhal steakhal deleted the bb/refactor branch September 9, 2025 12:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

clang:analysis clang:static analyzer clang Clang issues not falling into any other category

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants