[clang] ab74a31 - [NFC] [FlowSensitive] `LatticeJoinEffect` -> `LatticeEffect` (#160222)

via cfe-commits cfe-commits at lists.llvm.org
Tue Sep 23 09:22:50 PDT 2025


Author: Florian Mayer
Date: 2025-09-23T09:22:46-07:00
New Revision: ab74a3183f0eb15eb27855f2032599c81a8b162c

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

LOG: [NFC] [FlowSensitive] `LatticeJoinEffect` -> `LatticeEffect` (#160222)

`LatticeJoinEffect` is deprecated.

Added: 
    

Modified: 
    clang/include/clang/Analysis/FlowSensitive/CachedConstAccessorsLattice.h
    clang/unittests/Analysis/FlowSensitive/CachedConstAccessorsLatticeTest.cpp

Removed: 
    


################################################################################
diff  --git a/clang/include/clang/Analysis/FlowSensitive/CachedConstAccessorsLattice.h b/clang/include/clang/Analysis/FlowSensitive/CachedConstAccessorsLattice.h
index 78b03d325efd9..f653ee94bebe4 100644
--- a/clang/include/clang/Analysis/FlowSensitive/CachedConstAccessorsLattice.h
+++ b/clang/include/clang/Analysis/FlowSensitive/CachedConstAccessorsLattice.h
@@ -90,7 +90,7 @@ template <typename Base> class CachedConstAccessorsLattice : public Base {
     return Base::operator==(Other);
   }
 
-  LatticeJoinEffect join(const CachedConstAccessorsLattice &Other);
+  LatticeEffect join(const CachedConstAccessorsLattice &Other);
 
 private:
   // Maps a record storage location and const method to the value to return
@@ -127,7 +127,7 @@ joinConstMethodMap(
   for (auto &[Loc, DeclToT] : Map1) {
     auto It = Map2.find(Loc);
     if (It == Map2.end()) {
-      Effect = LatticeJoinEffect::Changed;
+      Effect = LatticeEffect::Changed;
       continue;
     }
     const auto &OtherDeclToT = It->second;
@@ -135,7 +135,7 @@ joinConstMethodMap(
     for (auto [Func, Var] : DeclToT) {
       T *OtherVar = OtherDeclToT.lookup(Func);
       if (OtherVar == nullptr || OtherVar != Var) {
-        Effect = LatticeJoinEffect::Changed;
+        Effect = LatticeEffect::Changed;
         continue;
       }
       JoinedDeclToT.insert({Func, Var});

diff  --git a/clang/unittests/Analysis/FlowSensitive/CachedConstAccessorsLatticeTest.cpp b/clang/unittests/Analysis/FlowSensitive/CachedConstAccessorsLatticeTest.cpp
index fb3ab7c0dc9b4..67b471e328b5e 100644
--- a/clang/unittests/Analysis/FlowSensitive/CachedConstAccessorsLatticeTest.cpp
+++ b/clang/unittests/Analysis/FlowSensitive/CachedConstAccessorsLatticeTest.cpp
@@ -42,7 +42,7 @@ using ast_matchers::selectFirst;
 
 using dataflow::DataflowAnalysisContext;
 using dataflow::Environment;
-using dataflow::LatticeJoinEffect;
+using dataflow::LatticeEffect;
 using dataflow::RecordStorageLocation;
 using dataflow::Value;
 using dataflow::WatchedLiteralsSolver;
@@ -270,11 +270,11 @@ TEST_F(CachedConstAccessorsLatticeTest, JoinSameNoop) {
 
   LatticeT EmptyLattice;
   LatticeT EmptyLattice2;
-  EXPECT_EQ(EmptyLattice.join(EmptyLattice2), LatticeJoinEffect::Unchanged);
+  EXPECT_EQ(EmptyLattice.join(EmptyLattice2), LatticeEffect::Unchanged);
 
   LatticeT Lattice1;
   Lattice1.getOrCreateConstMethodReturnValue(Loc, CE, Env);
-  EXPECT_EQ(Lattice1.join(Lattice1), LatticeJoinEffect::Unchanged);
+  EXPECT_EQ(Lattice1.join(Lattice1), LatticeEffect::Unchanged);
 }
 
 TEST_F(CachedConstAccessorsLatticeTest, ProducesNewValueAfterJoinDistinct) {
@@ -289,7 +289,7 @@ TEST_F(CachedConstAccessorsLatticeTest, ProducesNewValueAfterJoinDistinct) {
 
   LatticeT EmptyLattice;
 
-  EXPECT_EQ(Lattice1.join(EmptyLattice), LatticeJoinEffect::Changed);
+  EXPECT_EQ(Lattice1.join(EmptyLattice), LatticeEffect::Changed);
   Value *ValAfterJoin =
       Lattice1.getOrCreateConstMethodReturnValue(Loc, CE, Env);
 
@@ -299,7 +299,7 @@ TEST_F(CachedConstAccessorsLatticeTest, ProducesNewValueAfterJoinDistinct) {
   LatticeT Lattice3;
   Value *Val3 = Lattice3.getOrCreateConstMethodReturnValue(Loc, CE, Env);
 
-  EXPECT_EQ(Lattice1.join(Lattice3), LatticeJoinEffect::Changed);
+  EXPECT_EQ(Lattice1.join(Lattice3), LatticeEffect::Changed);
   Value *ValAfterJoin2 =
       Lattice1.getOrCreateConstMethodReturnValue(Loc, CE, Env);
 


        


More information about the cfe-commits mailing list