@@ -128,33 +128,6 @@ TEST_F(CachedConstAccessorsLatticeTest, SameLocBeforeClearOrDiffAfterClear) {
128128 RecordStorageLocation Loc (Inputs.SType , RecordStorageLocation::FieldToLoc (),
129129 {});
130130
131- LatticeT Lattice;
132- auto NopInit = [](StorageLocation &) {};
133- StorageLocation *Loc1 = Lattice.getOrCreateConstMethodReturnStorageLocation (
134- Loc, CE, Env, NopInit);
135- auto NotCalled = [](StorageLocation &) {
136- ASSERT_TRUE (false ) << " Not reached" ;
137- };
138- StorageLocation *Loc2 = Lattice.getOrCreateConstMethodReturnStorageLocation (
139- Loc, CE, Env, NotCalled);
140-
141- EXPECT_EQ (Loc1, Loc2);
142-
143- Lattice.clearConstMethodReturnStorageLocations (Loc);
144- StorageLocation *Loc3 = Lattice.getOrCreateConstMethodReturnStorageLocation (
145- Loc, CE, Env, NopInit);
146-
147- EXPECT_NE (Loc3, Loc1);
148- EXPECT_NE (Loc3, Loc2);
149- }
150-
151- TEST_F (CachedConstAccessorsLatticeTest,
152- SameLocBeforeClearOrDiffAfterClearWithCallee) {
153- CommonTestInputs Inputs;
154- auto *CE = Inputs.CallRef ;
155- RecordStorageLocation Loc (Inputs.SType , RecordStorageLocation::FieldToLoc (),
156- {});
157-
158131 LatticeT Lattice;
159132 auto NopInit = [](StorageLocation &) {};
160133 const FunctionDecl *Callee = CE->getDirectCallee ();
@@ -204,22 +177,24 @@ TEST_F(CachedConstAccessorsLatticeTest,
204177 // Accessors that return a record by value are modeled by a record storage
205178 // location (instead of a Value).
206179 auto NopInit = [](StorageLocation &) {};
207- StorageLocation *Loc1 = Lattice.getOrCreateConstMethodReturnStorageLocation (
208- Loc, CE, Env, NopInit);
180+ const FunctionDecl *Callee = CE->getDirectCallee ();
181+ ASSERT_NE (Callee, nullptr );
182+ StorageLocation &Loc1 = Lattice.getOrCreateConstMethodReturnStorageLocation (
183+ Loc, Callee, Env, NopInit);
209184 auto NotCalled = [](StorageLocation &) {
210185 ASSERT_TRUE (false ) << " Not reached" ;
211186 };
212- StorageLocation * Loc2 = Lattice.getOrCreateConstMethodReturnStorageLocation (
213- Loc, CE , Env, NotCalled);
187+ StorageLocation & Loc2 = Lattice.getOrCreateConstMethodReturnStorageLocation (
188+ Loc, Callee , Env, NotCalled);
214189
215- EXPECT_EQ (Loc1, Loc2);
190+ EXPECT_EQ (& Loc1, & Loc2);
216191
217192 Lattice.clearConstMethodReturnStorageLocations (Loc);
218- StorageLocation * Loc3 = Lattice.getOrCreateConstMethodReturnStorageLocation (
219- Loc, CE , Env, NopInit);
193+ StorageLocation & Loc3 = Lattice.getOrCreateConstMethodReturnStorageLocation (
194+ Loc, Callee , Env, NopInit);
220195
221- EXPECT_NE (Loc3, Loc1);
222- EXPECT_NE (Loc3, Loc1);
196+ EXPECT_NE (& Loc3, & Loc1);
197+ EXPECT_NE (& Loc3, & Loc1);
223198}
224199
225200TEST_F (CachedConstAccessorsLatticeTest, ClearDifferentLocs) {
@@ -232,18 +207,20 @@ TEST_F(CachedConstAccessorsLatticeTest, ClearDifferentLocs) {
232207
233208 LatticeT Lattice;
234209 auto NopInit = [](StorageLocation &) {};
235- StorageLocation *RetLoc1 =
236- Lattice.getOrCreateConstMethodReturnStorageLocation (LocS1, CE, Env,
210+ const FunctionDecl *Callee = CE->getDirectCallee ();
211+ ASSERT_NE (Callee, nullptr );
212+ StorageLocation &RetLoc1 =
213+ Lattice.getOrCreateConstMethodReturnStorageLocation (LocS1, Callee, Env,
237214 NopInit);
238215 Lattice.clearConstMethodReturnStorageLocations (LocS2);
239216 auto NotCalled = [](StorageLocation &) {
240217 ASSERT_TRUE (false ) << " Not reached" ;
241218 };
242- StorageLocation * RetLoc2 =
243- Lattice.getOrCreateConstMethodReturnStorageLocation (LocS1, CE , Env,
219+ StorageLocation & RetLoc2 =
220+ Lattice.getOrCreateConstMethodReturnStorageLocation (LocS1, Callee , Env,
244221 NotCalled);
245222
246- EXPECT_EQ (RetLoc1, RetLoc2);
223+ EXPECT_EQ (& RetLoc1, & RetLoc2);
247224}
248225
249226TEST_F (CachedConstAccessorsLatticeTest, DifferentValsFromDifferentLocs) {
0 commit comments