mboehme created this revision.
Herald added subscribers: martong, xazax.hun.
Herald added a reviewer: NoQ.
Herald added a project: All.
mboehme requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

This parameter was already a no-op, so removing it doesn't change behavior.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D150137

Files:
  clang/include/clang/Analysis/FlowSensitive/DataflowEnvironment.h
  clang/lib/Analysis/FlowSensitive/DataflowEnvironment.cpp
  clang/unittests/Analysis/FlowSensitive/ChromiumCheckModelTest.cpp
  clang/unittests/Analysis/FlowSensitive/DataflowEnvironmentTest.cpp
  clang/unittests/Analysis/FlowSensitive/SignAnalysisTest.cpp
  clang/unittests/Analysis/FlowSensitive/TestingSupport.h
  clang/unittests/Analysis/FlowSensitive/TransferTest.cpp
  clang/unittests/Analysis/FlowSensitive/TypeErasedDataflowAnalysisTest.cpp

Index: clang/unittests/Analysis/FlowSensitive/TypeErasedDataflowAnalysisTest.cpp
===================================================================
--- clang/unittests/Analysis/FlowSensitive/TypeErasedDataflowAnalysisTest.cpp
+++ clang/unittests/Analysis/FlowSensitive/TypeErasedDataflowAnalysisTest.cpp
@@ -489,8 +489,7 @@
         ASSERT_THAT(FooDecl, NotNull());
 
         auto GetFooValue = [FooDecl](const Environment &Env) {
-          return cast<BoolValue>(
-              Env.getValue(*FooDecl, SkipPast::None)->getProperty("is_set"));
+          return cast<BoolValue>(Env.getValue(*FooDecl)->getProperty("is_set"));
         };
 
         EXPECT_FALSE(Env1.flowConditionImplies(*GetFooValue(Env1)));
@@ -640,7 +639,7 @@
         ASSERT_THAT(FooDecl, NotNull());
 
         auto GetFooValue = [FooDecl](const Environment &Env) {
-          return Env.getValue(*FooDecl, SkipPast::None);
+          return Env.getValue(*FooDecl);
         };
 
         EXPECT_EQ(GetFooValue(Env1)->getProperty("has_value"),
@@ -685,7 +684,7 @@
         ASSERT_THAT(FooDecl, NotNull());
 
         auto GetFooValue = [FooDecl](const Environment &Env) {
-          return Env.getValue(*FooDecl, SkipPast::None);
+          return Env.getValue(*FooDecl);
         };
 
         EXPECT_EQ(GetFooValue(Env1)->getProperty("has_value"),
@@ -725,8 +724,7 @@
 
         const auto *FooLoc =
             cast<ScalarStorageLocation>(Env.getStorageLocation(*FooDecl));
-        const auto *BarVal =
-            cast<PointerValue>(Env.getValue(*BarDecl, SkipPast::None));
+        const auto *BarVal = cast<PointerValue>(Env.getValue(*BarDecl));
         EXPECT_EQ(&BarVal->getPointeeLoc(), FooLoc);
       });
 }
@@ -755,7 +753,7 @@
         const ValueDecl *FooDecl = findValueDecl(ASTCtx, "Foo");
         ASSERT_THAT(FooDecl, NotNull());
 
-        const auto *FooVal = Env.getValue(*FooDecl, SkipPast::None);
+        const auto *FooVal = Env.getValue(*FooDecl);
         EXPECT_EQ(FooVal->getProperty("has_value"),
                   &Env.getBoolLiteralValue(true));
       });
@@ -804,13 +802,11 @@
         ASSERT_THAT(Results.keys(), UnorderedElementsAre("p1", "p2"));
 
         const Environment &Env1 = getEnvironmentAtAnnotation(Results, "p1");
-        auto *FooVal1 =
-            cast<BoolValue>(Env1.getValue(*FooDecl, SkipPast::None));
+        auto *FooVal1 = cast<BoolValue>(Env1.getValue(*FooDecl));
         EXPECT_TRUE(Env1.flowConditionImplies(*FooVal1));
 
         const Environment &Env2 = getEnvironmentAtAnnotation(Results, "p2");
-        auto *FooVal2 =
-            cast<BoolValue>(Env2.getValue(*FooDecl, SkipPast::None));
+        auto *FooVal2 = cast<BoolValue>(Env2.getValue(*FooDecl));
         EXPECT_FALSE(Env2.flowConditionImplies(*FooVal2));
       });
 }
@@ -837,13 +833,11 @@
         ASSERT_THAT(Results.keys(), UnorderedElementsAre("p1", "p2"));
 
         const Environment &Env1 = getEnvironmentAtAnnotation(Results, "p1");
-        auto *FooVal1 =
-            cast<BoolValue>(Env1.getValue(*FooDecl, SkipPast::None));
+        auto *FooVal1 = cast<BoolValue>(Env1.getValue(*FooDecl));
         EXPECT_FALSE(Env1.flowConditionImplies(*FooVal1));
 
         const Environment &Env2 = getEnvironmentAtAnnotation(Results, "p2");
-        auto *FooVal2 =
-            cast<BoolValue>(Env2.getValue(*FooDecl, SkipPast::None));
+        auto *FooVal2 = cast<BoolValue>(Env2.getValue(*FooDecl));
         EXPECT_TRUE(Env2.flowConditionImplies(*FooVal2));
       });
 }
@@ -867,7 +861,7 @@
         ASSERT_THAT(Results.keys(), UnorderedElementsAre("p"));
         const Environment &Env = getEnvironmentAtAnnotation(Results, "p");
 
-        auto *FooVal = cast<BoolValue>(Env.getValue(*FooDecl, SkipPast::None));
+        auto *FooVal = cast<BoolValue>(Env.getValue(*FooDecl));
         EXPECT_TRUE(Env.flowConditionImplies(*FooVal));
       });
 }
@@ -896,14 +890,14 @@
     ASSERT_THAT(Results.keys(), UnorderedElementsAre("p1", "p2"));
 
     const Environment &Env1 = getEnvironmentAtAnnotation(Results, "p1");
-    auto *FooVal1 = cast<BoolValue>(Env1.getValue(*FooDecl, SkipPast::None));
-    auto *BarVal1 = cast<BoolValue>(Env1.getValue(*BarDecl, SkipPast::None));
+    auto *FooVal1 = cast<BoolValue>(Env1.getValue(*FooDecl));
+    auto *BarVal1 = cast<BoolValue>(Env1.getValue(*BarDecl));
     EXPECT_TRUE(Env1.flowConditionImplies(*FooVal1));
     EXPECT_TRUE(Env1.flowConditionImplies(*BarVal1));
 
     const Environment &Env2 = getEnvironmentAtAnnotation(Results, "p2");
-    auto *FooVal2 = cast<BoolValue>(Env2.getValue(*FooDecl, SkipPast::None));
-    auto *BarVal2 = cast<BoolValue>(Env2.getValue(*BarDecl, SkipPast::None));
+    auto *FooVal2 = cast<BoolValue>(Env2.getValue(*FooDecl));
+    auto *BarVal2 = cast<BoolValue>(Env2.getValue(*BarDecl));
     EXPECT_FALSE(Env2.flowConditionImplies(*FooVal2));
     EXPECT_FALSE(Env2.flowConditionImplies(*BarVal2));
   });
@@ -933,14 +927,14 @@
     ASSERT_THAT(Results.keys(), UnorderedElementsAre("p1", "p2"));
 
     const Environment &Env1 = getEnvironmentAtAnnotation(Results, "p1");
-    auto *FooVal1 = cast<BoolValue>(Env1.getValue(*FooDecl, SkipPast::None));
-    auto *BarVal1 = cast<BoolValue>(Env1.getValue(*BarDecl, SkipPast::None));
+    auto *FooVal1 = cast<BoolValue>(Env1.getValue(*FooDecl));
+    auto *BarVal1 = cast<BoolValue>(Env1.getValue(*BarDecl));
     EXPECT_FALSE(Env1.flowConditionImplies(*FooVal1));
     EXPECT_FALSE(Env1.flowConditionImplies(*BarVal1));
 
     const Environment &Env2 = getEnvironmentAtAnnotation(Results, "p2");
-    auto *FooVal2 = cast<BoolValue>(Env2.getValue(*FooDecl, SkipPast::None));
-    auto *BarVal2 = cast<BoolValue>(Env2.getValue(*BarDecl, SkipPast::None));
+    auto *FooVal2 = cast<BoolValue>(Env2.getValue(*FooDecl));
+    auto *BarVal2 = cast<BoolValue>(Env2.getValue(*BarDecl));
     EXPECT_FALSE(Env2.flowConditionImplies(*FooVal2));
     EXPECT_FALSE(Env2.flowConditionImplies(*BarVal2));
   });
@@ -970,14 +964,14 @@
     ASSERT_THAT(Results.keys(), UnorderedElementsAre("p1", "p2"));
 
     const Environment &Env1 = getEnvironmentAtAnnotation(Results, "p1");
-    auto *FooVal1 = cast<BoolValue>(Env1.getValue(*FooDecl, SkipPast::None));
-    auto *BarVal1 = cast<BoolValue>(Env1.getValue(*BarDecl, SkipPast::None));
+    auto *FooVal1 = cast<BoolValue>(Env1.getValue(*FooDecl));
+    auto *BarVal1 = cast<BoolValue>(Env1.getValue(*BarDecl));
     EXPECT_FALSE(Env1.flowConditionImplies(*FooVal1));
     EXPECT_FALSE(Env1.flowConditionImplies(*BarVal1));
 
     const Environment &Env2 = getEnvironmentAtAnnotation(Results, "p2");
-    auto *FooVal2 = cast<BoolValue>(Env2.getValue(*FooDecl, SkipPast::None));
-    auto *BarVal2 = cast<BoolValue>(Env2.getValue(*BarDecl, SkipPast::None));
+    auto *FooVal2 = cast<BoolValue>(Env2.getValue(*FooDecl));
+    auto *BarVal2 = cast<BoolValue>(Env2.getValue(*BarDecl));
     EXPECT_TRUE(Env2.flowConditionImplies(*FooVal2));
     EXPECT_TRUE(Env2.flowConditionImplies(*BarVal2));
   });
@@ -1007,14 +1001,14 @@
     ASSERT_THAT(Results.keys(), UnorderedElementsAre("p1", "p2"));
 
     const Environment &Env1 = getEnvironmentAtAnnotation(Results, "p1");
-    auto *FooVal1 = cast<BoolValue>(Env1.getValue(*FooDecl, SkipPast::None));
-    auto *BarVal1 = cast<BoolValue>(Env1.getValue(*BarDecl, SkipPast::None));
+    auto *FooVal1 = cast<BoolValue>(Env1.getValue(*FooDecl));
+    auto *BarVal1 = cast<BoolValue>(Env1.getValue(*BarDecl));
     EXPECT_TRUE(Env1.flowConditionImplies(*FooVal1));
     EXPECT_TRUE(Env1.flowConditionImplies(*BarVal1));
 
     const Environment &Env2 = getEnvironmentAtAnnotation(Results, "p2");
-    auto *FooVal2 = cast<BoolValue>(Env2.getValue(*FooDecl, SkipPast::None));
-    auto *BarVal2 = cast<BoolValue>(Env2.getValue(*BarDecl, SkipPast::None));
+    auto *FooVal2 = cast<BoolValue>(Env2.getValue(*FooDecl));
+    auto *BarVal2 = cast<BoolValue>(Env2.getValue(*BarDecl));
     EXPECT_FALSE(Env2.flowConditionImplies(*FooVal2));
     EXPECT_FALSE(Env2.flowConditionImplies(*BarVal2));
   });
@@ -1044,7 +1038,7 @@
         ASSERT_THAT(FooDecl, NotNull());
 
         const Environment &Env = getEnvironmentAtAnnotation(Results, "p");
-        auto *FooVal = cast<BoolValue>(Env.getValue(*FooDecl, SkipPast::None));
+        auto *FooVal = cast<BoolValue>(Env.getValue(*FooDecl));
         EXPECT_TRUE(Env.flowConditionImplies(*FooVal));
       });
 }
@@ -1077,8 +1071,7 @@
         const ValueDecl *BarDecl = findValueDecl(ASTCtx, "Bar");
         ASSERT_THAT(BarDecl, NotNull());
 
-        auto &BarVal =
-            *cast<BoolValue>(Env.getValue(*BarDecl, SkipPast::Reference));
+        auto &BarVal = *cast<BoolValue>(Env.getValue(*BarDecl));
 
         EXPECT_FALSE(Env.flowConditionImplies(BarVal));
       });
@@ -1119,8 +1112,7 @@
         const ValueDecl *BarDecl = findValueDecl(ASTCtx, "Bar");
         ASSERT_THAT(BarDecl, NotNull());
 
-        auto &BarVal =
-            *cast<BoolValue>(Env.getValue(*BarDecl, SkipPast::Reference));
+        auto &BarVal = *cast<BoolValue>(Env.getValue(*BarDecl));
 
         EXPECT_FALSE(Env.flowConditionImplies(BarVal));
       });
@@ -1154,8 +1146,7 @@
         const ValueDecl *BarDecl = findValueDecl(ASTCtx, "Bar");
         ASSERT_THAT(BarDecl, NotNull());
 
-        auto &BarVal =
-            *cast<BoolValue>(Env.getValue(*BarDecl, SkipPast::Reference));
+        auto &BarVal = *cast<BoolValue>(Env.getValue(*BarDecl));
 
         EXPECT_FALSE(Env.flowConditionImplies(BarVal));
       });
@@ -1184,13 +1175,11 @@
         ASSERT_THAT(FooDecl, NotNull());
 
         const Environment &Env1 = getEnvironmentAtAnnotation(Results, "p1");
-        auto &FooVal1 =
-            *cast<BoolValue>(Env1.getValue(*FooDecl, SkipPast::Reference));
+        auto &FooVal1 = *cast<BoolValue>(Env1.getValue(*FooDecl));
         EXPECT_TRUE(Env1.flowConditionImplies(FooVal1));
 
         const Environment &Env2 = getEnvironmentAtAnnotation(Results, "p2");
-        auto &FooVal2 =
-            *cast<BoolValue>(Env2.getValue(*FooDecl, SkipPast::Reference));
+        auto &FooVal2 = *cast<BoolValue>(Env2.getValue(*FooDecl));
         EXPECT_FALSE(Env2.flowConditionImplies(FooVal2));
       });
 }
@@ -1267,9 +1256,8 @@
         const ValueDecl *FooDecl = findValueDecl(AO.ASTCtx, "Foo");
         ASSERT_THAT(FooDecl, NotNull());
 
-
         auto GetFooValue = [FooDecl](const Environment &Env) {
-          return Env.getValue(*FooDecl, SkipPast::None);
+          return Env.getValue(*FooDecl);
         };
 
         Value *FooVal1 = GetFooValue(Env1);
@@ -1313,9 +1301,8 @@
         const ValueDecl *FooDecl = findValueDecl(AO.ASTCtx, "Foo");
         ASSERT_THAT(FooDecl, NotNull());
 
-
         auto GetFooValue = [FooDecl](const Environment &Env) {
-          return Env.getValue(*FooDecl, SkipPast::None);
+          return Env.getValue(*FooDecl);
         };
 
         Value *FooVal1 = GetFooValue(Env1);
@@ -1366,7 +1353,7 @@
         ASSERT_THAT(FooDecl, NotNull());
 
         auto GetFooValue = [FooDecl](const Environment &Env) {
-          return Env.getValue(*FooDecl, SkipPast::None);
+          return Env.getValue(*FooDecl);
         };
 
         Value *FooVal1 = GetFooValue(Env1);
@@ -1421,7 +1408,7 @@
         ASSERT_THAT(FooDecl, NotNull());
 
         auto GetFooValue = [FooDecl](const Environment &Env) {
-          return Env.getValue(*FooDecl, SkipPast::None);
+          return Env.getValue(*FooDecl);
         };
 
         Value *FooVal0 = GetFooValue(Env0);
@@ -1477,7 +1464,7 @@
         ASSERT_THAT(FooDecl, NotNull());
 
         auto GetFooValue = [FooDecl](const Environment &Env) {
-          return Env.getValue(*FooDecl, SkipPast::None);
+          return Env.getValue(*FooDecl);
         };
 
         Value *FooVal1 = GetFooValue(Env1);
@@ -1525,12 +1512,10 @@
         const ValueDecl *BarDecl = findValueDecl(AO.ASTCtx, "Bar");
         ASSERT_THAT(BarDecl, NotNull());
 
-        auto *FooVal =
-            dyn_cast_or_null<BoolValue>(Env.getValue(*FooDecl, SkipPast::None));
+        auto *FooVal = dyn_cast_or_null<BoolValue>(Env.getValue(*FooDecl));
         ASSERT_THAT(FooVal, NotNull());
 
-        auto *BarVal =
-            dyn_cast_or_null<BoolValue>(Env.getValue(*BarDecl, SkipPast::None));
+        auto *BarVal = dyn_cast_or_null<BoolValue>(Env.getValue(*BarDecl));
         ASSERT_THAT(BarVal, NotNull());
 
         EXPECT_TRUE(Env.flowConditionImplies(Env.makeIff(*FooVal, *BarVal)));
@@ -1570,7 +1555,7 @@
         ASSERT_THAT(FooDecl, NotNull());
 
         auto GetFooValue = [FooDecl](const Environment &Env) {
-          return Env.getValue(*FooDecl, SkipPast::None);
+          return Env.getValue(*FooDecl);
         };
 
         Value *FooVal1 = GetFooValue(Env1);
Index: clang/unittests/Analysis/FlowSensitive/TransferTest.cpp
===================================================================
--- clang/unittests/Analysis/FlowSensitive/TransferTest.cpp
+++ clang/unittests/Analysis/FlowSensitive/TransferTest.cpp
@@ -173,8 +173,7 @@
 
         const ValueDecl *FooDecl = findValueDecl(ASTCtx, "Foo");
         ASSERT_THAT(FooDecl, NotNull());
-        auto *FooValue = dyn_cast_or_null<PointerValue>(
-            Env.getValue(*FooDecl, SkipPast::None));
+        auto *FooValue = dyn_cast_or_null<PointerValue>(Env.getValue(*FooDecl));
         ASSERT_THAT(FooValue, NotNull());
 
         EXPECT_TRUE(isa<AggregateStorageLocation>(FooValue->getPointeeLoc()));
@@ -234,7 +233,7 @@
 
         const ValueDecl *ZabDecl = findValueDecl(ASTCtx, "Zab");
         ASSERT_THAT(ZabDecl, NotNull());
-        EXPECT_THAT(Env.getValue(*ZabDecl, SkipPast::None), NotNull());
+        EXPECT_THAT(Env.getValue(*ZabDecl), NotNull());
       });
 }
 
@@ -788,13 +787,13 @@
         const ValueDecl *FooDecl = findValueDecl(ASTCtx, "Foo");
         ASSERT_THAT(FooDecl, NotNull());
 
-        const Value *FooVal = Env.getValue(*FooDecl, SkipPast::None);
+        const Value *FooVal = Env.getValue(*FooDecl);
         ASSERT_TRUE(isa_and_nonnull<IntegerValue>(FooVal));
 
         const ValueDecl *BarDecl = findValueDecl(ASTCtx, "Bar");
         ASSERT_THAT(BarDecl, NotNull());
 
-        EXPECT_EQ(Env.getValue(*BarDecl, SkipPast::None), FooVal);
+        EXPECT_EQ(Env.getValue(*BarDecl), FooVal);
       });
 }
 
@@ -816,13 +815,13 @@
         const ValueDecl *FooDecl = findValueDecl(ASTCtx, "Foo");
         ASSERT_THAT(FooDecl, NotNull());
 
-        const Value *FooVal = Env.getValue(*FooDecl, SkipPast::None);
+        const Value *FooVal = Env.getValue(*FooDecl);
         ASSERT_TRUE(isa_and_nonnull<IntegerValue>(FooVal));
 
         const ValueDecl *BarDecl = findValueDecl(ASTCtx, "Bar");
         ASSERT_THAT(BarDecl, NotNull());
 
-        EXPECT_EQ(Env.getValue(*BarDecl, SkipPast::None), FooVal);
+        EXPECT_EQ(Env.getValue(*BarDecl), FooVal);
       });
 }
 
@@ -845,7 +844,7 @@
         const ValueDecl *FooDecl = findValueDecl(ASTCtx, "Foo");
         ASSERT_THAT(FooDecl, NotNull());
 
-        const Value *FooVal = Env.getValue(*FooDecl, SkipPast::None);
+        const Value *FooVal = Env.getValue(*FooDecl);
         ASSERT_TRUE(isa_and_nonnull<IntegerValue>(FooVal));
 
         const ValueDecl *BarDecl = findValueDecl(ASTCtx, "Bar");
@@ -854,8 +853,8 @@
         const ValueDecl *BazDecl = findValueDecl(ASTCtx, "Baz");
         ASSERT_THAT(BazDecl, NotNull());
 
-        EXPECT_EQ(Env.getValue(*BarDecl, SkipPast::None), FooVal);
-        EXPECT_EQ(Env.getValue(*BazDecl, SkipPast::None), FooVal);
+        EXPECT_EQ(Env.getValue(*BarDecl), FooVal);
+        EXPECT_EQ(Env.getValue(*BazDecl), FooVal);
       });
 }
 
@@ -879,20 +878,19 @@
         const ValueDecl *FooDecl = findValueDecl(ASTCtx, "Foo");
         ASSERT_THAT(FooDecl, NotNull());
 
-        const Value *FooVal = Env.getValue(*FooDecl, SkipPast::None);
+        const Value *FooVal = Env.getValue(*FooDecl);
         ASSERT_TRUE(isa_and_nonnull<IntegerValue>(FooVal));
 
         const ValueDecl *BarDecl = findValueDecl(ASTCtx, "Bar");
         ASSERT_THAT(BarDecl, NotNull());
 
-        const auto *BarVal =
-            cast<PointerValue>(Env.getValue(*BarDecl, SkipPast::None));
+        const auto *BarVal = cast<PointerValue>(Env.getValue(*BarDecl));
         EXPECT_EQ(Env.getValue(BarVal->getPointeeLoc()), FooVal);
 
         const ValueDecl *BazDecl = findValueDecl(ASTCtx, "Baz");
         ASSERT_THAT(BazDecl, NotNull());
 
-        EXPECT_EQ(Env.getValue(*BazDecl, SkipPast::None), FooVal);
+        EXPECT_EQ(Env.getValue(*BazDecl), FooVal);
       });
 }
 
@@ -920,30 +918,30 @@
         const ValueDecl *FooDecl = findValueDecl(ASTCtx, "Foo");
         ASSERT_THAT(FooDecl, NotNull());
 
-        const Value *FooVal = Env1.getValue(*FooDecl, SkipPast::None);
+        const Value *FooVal = Env1.getValue(*FooDecl);
         ASSERT_TRUE(isa_and_nonnull<IntegerValue>(FooVal));
 
         const ValueDecl *BarDecl = findValueDecl(ASTCtx, "Bar");
         ASSERT_THAT(BarDecl, NotNull());
 
-        const Value *BarVal = Env1.getValue(*BarDecl, SkipPast::None);
+        const Value *BarVal = Env1.getValue(*BarDecl);
         ASSERT_TRUE(isa_and_nonnull<IntegerValue>(BarVal));
 
         const ValueDecl *BazDecl = findValueDecl(ASTCtx, "Baz");
         ASSERT_THAT(BazDecl, NotNull());
 
-        EXPECT_EQ(Env1.getValue(*BazDecl, SkipPast::Reference), FooVal);
+        EXPECT_EQ(Env1.getValue(*BazDecl), FooVal);
 
-        EXPECT_EQ(Env2.getValue(*BazDecl, SkipPast::Reference), BarVal);
-        EXPECT_EQ(Env2.getValue(*FooDecl, SkipPast::None), BarVal);
+        EXPECT_EQ(Env2.getValue(*BazDecl), BarVal);
+        EXPECT_EQ(Env2.getValue(*FooDecl), BarVal);
 
         const ValueDecl *QuxDecl = findValueDecl(ASTCtx, "Qux");
         ASSERT_THAT(QuxDecl, NotNull());
-        EXPECT_EQ(Env2.getValue(*QuxDecl, SkipPast::None), BarVal);
+        EXPECT_EQ(Env2.getValue(*QuxDecl), BarVal);
 
         const ValueDecl *QuuxDecl = findValueDecl(ASTCtx, "Quux");
         ASSERT_THAT(QuuxDecl, NotNull());
-        EXPECT_EQ(Env2.getValue(*QuuxDecl, SkipPast::Reference), BarVal);
+        EXPECT_EQ(Env2.getValue(*QuuxDecl), BarVal);
       });
 }
 
@@ -1126,7 +1124,7 @@
         const ValueDecl *BazDecl = findValueDecl(ASTCtx, "Baz");
         ASSERT_THAT(BazDecl, NotNull());
 
-        EXPECT_EQ(Env.getValue(*BazDecl, SkipPast::None), BarVal);
+        EXPECT_EQ(Env.getValue(*BazDecl), BarVal);
       });
 }
 
@@ -1396,7 +1394,7 @@
         const ValueDecl *BazDecl = findValueDecl(ASTCtx, "Baz");
         ASSERT_THAT(BazDecl, NotNull());
 
-        EXPECT_EQ(Env.getValue(*BazDecl, SkipPast::None), BarVal);
+        EXPECT_EQ(Env.getValue(*BazDecl), BarVal);
       });
 }
 
@@ -1488,7 +1486,7 @@
         const ValueDecl *BazDecl = findValueDecl(ASTCtx, "Baz");
         ASSERT_THAT(BazDecl, NotNull());
 
-        EXPECT_EQ(Env.getValue(*BazDecl, SkipPast::None), BarReferentVal);
+        EXPECT_EQ(Env.getValue(*BazDecl), BarReferentVal);
       });
 }
 
@@ -1533,7 +1531,7 @@
 
         const ValueDecl *FooDecl = findValueDecl(ASTCtx, "Foo");
         ASSERT_THAT(FooDecl, NotNull());
-        EXPECT_EQ(Env.getValue(*FooDecl, SkipPast::None), BarVal);
+        EXPECT_EQ(Env.getValue(*FooDecl), BarVal);
 
         const ValueDecl *QuxDecl = findValueDecl(ASTCtx, "Qux");
         ASSERT_THAT(QuxDecl, NotNull());
@@ -1563,7 +1561,7 @@
 
         const ValueDecl *QuuxDecl = findValueDecl(ASTCtx, "Quux");
         ASSERT_THAT(QuuxDecl, NotNull());
-        EXPECT_EQ(Env.getValue(*QuuxDecl, SkipPast::None), BazVal);
+        EXPECT_EQ(Env.getValue(*QuuxDecl), BazVal);
       });
 }
 
@@ -1608,7 +1606,7 @@
 
         const ValueDecl *FooDecl = findValueDecl(ASTCtx, "Foo");
         ASSERT_THAT(FooDecl, NotNull());
-        EXPECT_EQ(Env.getValue(*FooDecl, SkipPast::None), BarVal);
+        EXPECT_EQ(Env.getValue(*FooDecl), BarVal);
 
         const ValueDecl *QuxDecl = findValueDecl(ASTCtx, "Qux");
         ASSERT_THAT(QuxDecl, NotNull());
@@ -1638,7 +1636,7 @@
 
         const ValueDecl *QuuxDecl = findValueDecl(ASTCtx, "Quux");
         ASSERT_THAT(QuuxDecl, NotNull());
-        EXPECT_EQ(Env.getValue(*QuuxDecl, SkipPast::None), BazVal);
+        EXPECT_EQ(Env.getValue(*QuuxDecl), BazVal);
       });
 }
 
@@ -1726,7 +1724,7 @@
 
         const ValueDecl *FooDecl = findValueDecl(ASTCtx, "Foo");
         ASSERT_THAT(FooDecl, NotNull());
-        EXPECT_EQ(Env.getValue(*FooDecl, SkipPast::None), BarVal);
+        EXPECT_EQ(Env.getValue(*FooDecl), BarVal);
       },
       LangStandard::lang_cxx17, /*ApplyBuiltinTransfer=*/true, "operator()");
 
@@ -1765,7 +1763,7 @@
 
         const ValueDecl *FooDecl = findValueDecl(ASTCtx, "Foo");
         ASSERT_THAT(FooDecl, NotNull());
-        EXPECT_EQ(Env.getValue(*FooDecl, SkipPast::None), BarVal);
+        EXPECT_EQ(Env.getValue(*FooDecl), BarVal);
       },
       LangStandard::lang_cxx17, /*ApplyBuiltinTransfer=*/true, "operator()");
 
@@ -1815,12 +1813,11 @@
         const ValueDecl *FooDecl = findValueDecl(ASTCtx, "Foo");
         ASSERT_THAT(FooDecl, NotNull());
 
-        const auto *FooVal =
-            cast<IntegerValue>(Env.getValue(*FooDecl, SkipPast::None));
+        const auto *FooVal = cast<IntegerValue>(Env.getValue(*FooDecl));
 
         const ValueDecl *QuxDecl = findValueDecl(ASTCtx, "Qux");
         ASSERT_THAT(QuxDecl, NotNull());
-        EXPECT_EQ(Env.getValue(*QuxDecl, SkipPast::None), FooVal);
+        EXPECT_EQ(Env.getValue(*QuxDecl), FooVal);
       });
 }
 
@@ -1850,12 +1847,11 @@
         const ValueDecl *FooDecl = findValueDecl(ASTCtx, "Foo");
         ASSERT_THAT(FooDecl, NotNull());
 
-        const auto *FooVal =
-            cast<IntegerValue>(Env.getValue(*FooDecl, SkipPast::None));
+        const auto *FooVal = cast<IntegerValue>(Env.getValue(*FooDecl));
 
         const ValueDecl *QuxDecl = findValueDecl(ASTCtx, "Qux");
         ASSERT_THAT(QuxDecl, NotNull());
-        EXPECT_EQ(Env.getValue(*QuxDecl, SkipPast::None), FooVal);
+        EXPECT_EQ(Env.getValue(*QuxDecl), FooVal);
       });
 }
 
@@ -2275,10 +2271,8 @@
         const ValueDecl *BazDecl = findValueDecl(ASTCtx, "Baz");
         ASSERT_THAT(BazDecl, NotNull());
 
-        const auto &FooVal =
-            *cast<StructValue>(Env.getValue(*FooDecl, SkipPast::None));
-        const auto *BarVal =
-            cast<IntegerValue>(Env.getValue(*BarDecl, SkipPast::None));
+        const auto &FooVal = *cast<StructValue>(Env.getValue(*FooDecl));
+        const auto *BarVal = cast<IntegerValue>(Env.getValue(*BarDecl));
         EXPECT_EQ(BarVal, FooVal.getChild(*BazDecl));
       });
 }
@@ -2303,8 +2297,8 @@
         const ValueDecl *BarDecl = findValueDecl(ASTCtx, "Bar");
         ASSERT_THAT(BarDecl, NotNull());
 
-        const auto *FooVal = Env.getValue(*FooDecl, SkipPast::None);
-        const auto *BarVal = Env.getValue(*BarDecl, SkipPast::None);
+        const auto *FooVal = Env.getValue(*FooDecl);
+        const auto *BarVal = Env.getValue(*BarDecl);
         EXPECT_TRUE(isa<IntegerValue>(FooVal));
         EXPECT_TRUE(isa<IntegerValue>(BarVal));
         EXPECT_EQ(FooVal, BarVal);
@@ -2331,8 +2325,8 @@
         const ValueDecl *BarDecl = findValueDecl(ASTCtx, "Bar");
         ASSERT_THAT(BarDecl, NotNull());
 
-        const auto *FooVal = Env.getValue(*FooDecl, SkipPast::None);
-        const auto *BarVal = Env.getValue(*BarDecl, SkipPast::None);
+        const auto *FooVal = Env.getValue(*FooDecl);
+        const auto *BarVal = Env.getValue(*BarDecl);
         EXPECT_TRUE(isa<IntegerValue>(FooVal));
         EXPECT_TRUE(isa<IntegerValue>(BarVal));
         EXPECT_EQ(FooVal, BarVal);
@@ -2359,8 +2353,8 @@
         const ValueDecl *BarDecl = findValueDecl(ASTCtx, "Bar");
         ASSERT_THAT(BarDecl, NotNull());
 
-        const auto *FooVal = Env.getValue(*FooDecl, SkipPast::None);
-        const auto *BarVal = Env.getValue(*BarDecl, SkipPast::None);
+        const auto *FooVal = Env.getValue(*FooDecl);
+        const auto *BarVal = Env.getValue(*BarDecl);
         EXPECT_TRUE(isa<IntegerValue>(FooVal));
         EXPECT_TRUE(isa<BoolValue>(BarVal));
       });
@@ -2387,8 +2381,8 @@
         const ValueDecl *BarDecl = findValueDecl(ASTCtx, "Bar");
         ASSERT_THAT(BarDecl, NotNull());
 
-        const auto *FooVal = Env.getValue(*FooDecl, SkipPast::None);
-        const auto *BarVal = Env.getValue(*BarDecl, SkipPast::None);
+        const auto *FooVal = Env.getValue(*FooDecl);
+        const auto *BarVal = Env.getValue(*BarDecl);
         EXPECT_TRUE(isa<BoolValue>(FooVal));
         EXPECT_TRUE(isa<BoolValue>(BarVal));
         EXPECT_EQ(FooVal, BarVal);
@@ -2430,16 +2424,11 @@
         const ValueDecl *NullDecl = findValueDecl(ASTCtx, "Null");
         ASSERT_THAT(NullDecl, NotNull());
 
-        const auto *FooXVal =
-            cast<PointerValue>(Env.getValue(*FooXDecl, SkipPast::None));
-        const auto *FooYVal =
-            cast<PointerValue>(Env.getValue(*FooYDecl, SkipPast::None));
-        const auto *BarVal =
-            cast<PointerValue>(Env.getValue(*BarDecl, SkipPast::None));
-        const auto *BazVal =
-            cast<PointerValue>(Env.getValue(*BazDecl, SkipPast::None));
-        const auto *NullVal =
-            cast<PointerValue>(Env.getValue(*NullDecl, SkipPast::None));
+        const auto *FooXVal = cast<PointerValue>(Env.getValue(*FooXDecl));
+        const auto *FooYVal = cast<PointerValue>(Env.getValue(*FooYDecl));
+        const auto *BarVal = cast<PointerValue>(Env.getValue(*BarDecl));
+        const auto *BazVal = cast<PointerValue>(Env.getValue(*BazDecl));
+        const auto *NullVal = cast<PointerValue>(Env.getValue(*NullDecl));
 
         EXPECT_EQ(FooXVal, FooYVal);
         EXPECT_NE(FooXVal, BarVal);
@@ -2483,8 +2472,8 @@
             findValueDecl(ASTCtx, "MemberPointer");
         ASSERT_THAT(MemberPointerDecl, NotNull());
 
-        const auto *MemberPointerVal = cast<PointerValue>(
-            Env.getValue(*MemberPointerDecl, SkipPast::None));
+        const auto *MemberPointerVal =
+            cast<PointerValue>(Env.getValue(*MemberPointerDecl));
 
         const StorageLocation &MemberLoc = MemberPointerVal->getPointeeLoc();
         EXPECT_THAT(Env.getValue(MemberLoc), IsNull());
@@ -2514,8 +2503,7 @@
 
         const auto *FooLoc =
             cast<ScalarStorageLocation>(Env.getStorageLocation(*FooDecl));
-        const auto *BarVal =
-            cast<PointerValue>(Env.getValue(*BarDecl, SkipPast::None));
+        const auto *BarVal = cast<PointerValue>(Env.getValue(*BarDecl));
         EXPECT_EQ(&BarVal->getPointeeLoc(), FooLoc);
       });
 }
@@ -2540,10 +2528,8 @@
         const ValueDecl *BarDecl = findValueDecl(ASTCtx, "Bar");
         ASSERT_THAT(BarDecl, NotNull());
 
-        const auto *FooVal =
-            cast<PointerValue>(Env.getValue(*FooDecl, SkipPast::None));
-        const auto *BarVal =
-            cast<PointerValue>(Env.getValue(*BarDecl, SkipPast::None));
+        const auto *FooVal = cast<PointerValue>(Env.getValue(*FooDecl));
+        const auto *BarVal = cast<PointerValue>(Env.getValue(*BarDecl));
         EXPECT_EQ(&BarVal->getPointeeLoc(), &FooVal->getPointeeLoc());
       });
 }
@@ -2569,8 +2555,7 @@
         const ValueDecl *BarDecl = findValueDecl(ASTCtx, "Bar");
         ASSERT_THAT(BarDecl, NotNull());
 
-        const auto *FooVal =
-            cast<PointerValue>(Env.getValue(*FooDecl, SkipPast::None));
+        const auto *FooVal = cast<PointerValue>(Env.getValue(*FooDecl));
         const auto *BarLoc = Env.getStorageLocation(*BarDecl);
         EXPECT_EQ(BarLoc, &FooVal->getPointeeLoc());
       });
@@ -2601,13 +2586,10 @@
         const ValueDecl *BazDecl = findValueDecl(ASTCtx, "Baz");
         ASSERT_THAT(BazDecl, NotNull());
 
-        const auto *FooVal =
-            cast<StructValue>(Env.getValue(*FooDecl, SkipPast::None));
-        const auto *BarVal =
-            cast<StructValue>(Env.getValue(*BarDecl, SkipPast::None));
+        const auto *FooVal = cast<StructValue>(Env.getValue(*FooDecl));
+        const auto *BarVal = cast<StructValue>(Env.getValue(*BarDecl));
 
-        const auto *BazVal =
-            dyn_cast<StructValue>(Env.getValue(*BazDecl, SkipPast::None));
+        const auto *BazVal = dyn_cast<StructValue>(Env.getValue(*BazDecl));
         ASSERT_THAT(BazVal, NotNull());
 
         EXPECT_NE(BazVal, FooVal);
@@ -2739,15 +2721,11 @@
           const ValueDecl *QuuxDecl = findValueDecl(ASTCtx, "Quux");
           ASSERT_THAT(QuuxDecl, NotNull());
 
-          const auto *FooArgVal =
-              cast<IntegerValue>(Env.getValue(*FooArgDecl, SkipPast::None));
-          const auto *BarArgVal =
-              cast<IntegerValue>(Env.getValue(*BarArgDecl, SkipPast::None));
-          const auto *QuxArgVal =
-              cast<IntegerValue>(Env.getValue(*QuxArgDecl, SkipPast::None));
+          const auto *FooArgVal = cast<IntegerValue>(Env.getValue(*FooArgDecl));
+          const auto *BarArgVal = cast<IntegerValue>(Env.getValue(*BarArgDecl));
+          const auto *QuxArgVal = cast<IntegerValue>(Env.getValue(*QuxArgDecl));
 
-          const auto *QuuxVal =
-              cast<StructValue>(Env.getValue(*QuuxDecl, SkipPast::None));
+          const auto *QuuxVal = cast<StructValue>(Env.getValue(*QuuxDecl));
           ASSERT_THAT(QuuxVal, NotNull());
 
           const auto *BazVal = cast<StructValue>(QuuxVal->getChild(*BazDecl));
@@ -2832,15 +2810,15 @@
         const ValueDecl *FooDecl = findValueDecl(ASTCtx, "Foo");
         ASSERT_THAT(FooDecl, NotNull());
 
-        const auto *FooVal = dyn_cast_or_null<AtomicBoolValue>(
-            Env.getValue(*FooDecl, SkipPast::None));
+        const auto *FooVal =
+            dyn_cast_or_null<AtomicBoolValue>(Env.getValue(*FooDecl));
         ASSERT_THAT(FooVal, NotNull());
 
         const ValueDecl *BarDecl = findValueDecl(ASTCtx, "Bar");
         ASSERT_THAT(BarDecl, NotNull());
 
-        const auto *BarVal = dyn_cast_or_null<AtomicBoolValue>(
-            Env.getValue(*BarDecl, SkipPast::None));
+        const auto *BarVal =
+            dyn_cast_or_null<AtomicBoolValue>(Env.getValue(*BarDecl));
         ASSERT_THAT(BarVal, NotNull());
 
         EXPECT_EQ(FooVal, &Env.getBoolLiteralValue(true));
@@ -2866,29 +2844,29 @@
           const ValueDecl *FooDecl = findValueDecl(ASTCtx, "Foo");
           ASSERT_THAT(FooDecl, NotNull());
 
-          const auto *FooVal = dyn_cast_or_null<BoolValue>(
-              Env.getValue(*FooDecl, SkipPast::None));
+          const auto *FooVal =
+              dyn_cast_or_null<BoolValue>(Env.getValue(*FooDecl));
           ASSERT_THAT(FooVal, NotNull());
 
           const ValueDecl *BarDecl = findValueDecl(ASTCtx, "Bar");
           ASSERT_THAT(BarDecl, NotNull());
 
-          const auto *BarVal = dyn_cast_or_null<BoolValue>(
-              Env.getValue(*BarDecl, SkipPast::None));
+          const auto *BarVal =
+              dyn_cast_or_null<BoolValue>(Env.getValue(*BarDecl));
           ASSERT_THAT(BarVal, NotNull());
 
           const ValueDecl *QuxDecl = findValueDecl(ASTCtx, "Qux");
           ASSERT_THAT(QuxDecl, NotNull());
 
-          const auto *QuxVal = dyn_cast_or_null<BoolValue>(
-              Env.getValue(*QuxDecl, SkipPast::None));
+          const auto *QuxVal =
+              dyn_cast_or_null<BoolValue>(Env.getValue(*QuxDecl));
           ASSERT_THAT(QuxVal, NotNull());
 
           const ValueDecl *BazDecl = findValueDecl(ASTCtx, "Baz");
           ASSERT_THAT(BazDecl, NotNull());
 
-          const auto *BazVal = dyn_cast_or_null<ConjunctionValue>(
-              Env.getValue(*BazDecl, SkipPast::None));
+          const auto *BazVal =
+              dyn_cast_or_null<ConjunctionValue>(Env.getValue(*BazDecl));
           ASSERT_THAT(BazVal, NotNull());
           EXPECT_EQ(&BazVal->getLeftSubValue(), FooVal);
 
@@ -2916,29 +2894,29 @@
           const ValueDecl *FooDecl = findValueDecl(ASTCtx, "Foo");
           ASSERT_THAT(FooDecl, NotNull());
 
-          const auto *FooVal = dyn_cast_or_null<BoolValue>(
-              Env.getValue(*FooDecl, SkipPast::None));
+          const auto *FooVal =
+              dyn_cast_or_null<BoolValue>(Env.getValue(*FooDecl));
           ASSERT_THAT(FooVal, NotNull());
 
           const ValueDecl *BarDecl = findValueDecl(ASTCtx, "Bar");
           ASSERT_THAT(BarDecl, NotNull());
 
-          const auto *BarVal = dyn_cast_or_null<BoolValue>(
-              Env.getValue(*BarDecl, SkipPast::None));
+          const auto *BarVal =
+              dyn_cast_or_null<BoolValue>(Env.getValue(*BarDecl));
           ASSERT_THAT(BarVal, NotNull());
 
           const ValueDecl *QuxDecl = findValueDecl(ASTCtx, "Qux");
           ASSERT_THAT(QuxDecl, NotNull());
 
-          const auto *QuxVal = dyn_cast_or_null<BoolValue>(
-              Env.getValue(*QuxDecl, SkipPast::None));
+          const auto *QuxVal =
+              dyn_cast_or_null<BoolValue>(Env.getValue(*QuxDecl));
           ASSERT_THAT(QuxVal, NotNull());
 
           const ValueDecl *BazDecl = findValueDecl(ASTCtx, "Baz");
           ASSERT_THAT(BazDecl, NotNull());
 
-          const auto *BazVal = dyn_cast_or_null<DisjunctionValue>(
-              Env.getValue(*BazDecl, SkipPast::None));
+          const auto *BazVal =
+              dyn_cast_or_null<DisjunctionValue>(Env.getValue(*BazDecl));
           ASSERT_THAT(BazVal, NotNull());
 
           const auto *BazLeftSubValVal =
@@ -2967,36 +2945,32 @@
           const ValueDecl *ADecl = findValueDecl(ASTCtx, "A");
           ASSERT_THAT(ADecl, NotNull());
 
-          const auto *AVal =
-              dyn_cast_or_null<BoolValue>(Env.getValue(*ADecl, SkipPast::None));
+          const auto *AVal = dyn_cast_or_null<BoolValue>(Env.getValue(*ADecl));
           ASSERT_THAT(AVal, NotNull());
 
           const ValueDecl *BDecl = findValueDecl(ASTCtx, "B");
           ASSERT_THAT(BDecl, NotNull());
 
-          const auto *BVal =
-              dyn_cast_or_null<BoolValue>(Env.getValue(*BDecl, SkipPast::None));
+          const auto *BVal = dyn_cast_or_null<BoolValue>(Env.getValue(*BDecl));
           ASSERT_THAT(BVal, NotNull());
 
           const ValueDecl *CDecl = findValueDecl(ASTCtx, "C");
           ASSERT_THAT(CDecl, NotNull());
 
-          const auto *CVal =
-              dyn_cast_or_null<BoolValue>(Env.getValue(*CDecl, SkipPast::None));
+          const auto *CVal = dyn_cast_or_null<BoolValue>(Env.getValue(*CDecl));
           ASSERT_THAT(CVal, NotNull());
 
           const ValueDecl *DDecl = findValueDecl(ASTCtx, "D");
           ASSERT_THAT(DDecl, NotNull());
 
-          const auto *DVal =
-              dyn_cast_or_null<BoolValue>(Env.getValue(*DDecl, SkipPast::None));
+          const auto *DVal = dyn_cast_or_null<BoolValue>(Env.getValue(*DDecl));
           ASSERT_THAT(DVal, NotNull());
 
           const ValueDecl *FooDecl = findValueDecl(ASTCtx, "Foo");
           ASSERT_THAT(FooDecl, NotNull());
 
-          const auto *FooVal = dyn_cast_or_null<ConjunctionValue>(
-              Env.getValue(*FooDecl, SkipPast::None));
+          const auto *FooVal =
+              dyn_cast_or_null<ConjunctionValue>(Env.getValue(*FooDecl));
           ASSERT_THAT(FooVal, NotNull());
 
           const auto &FooLeftSubVal =
@@ -3029,15 +3003,15 @@
         const ValueDecl *FooDecl = findValueDecl(ASTCtx, "Foo");
         ASSERT_THAT(FooDecl, NotNull());
 
-        const auto *FooVal = dyn_cast_or_null<AtomicBoolValue>(
-            Env.getValue(*FooDecl, SkipPast::None));
+        const auto *FooVal =
+            dyn_cast_or_null<AtomicBoolValue>(Env.getValue(*FooDecl));
         ASSERT_THAT(FooVal, NotNull());
 
         const ValueDecl *BarDecl = findValueDecl(ASTCtx, "Bar");
         ASSERT_THAT(BarDecl, NotNull());
 
-        const auto *BarVal = dyn_cast_or_null<NegationValue>(
-            Env.getValue(*BarDecl, SkipPast::None));
+        const auto *BarVal =
+            dyn_cast_or_null<NegationValue>(Env.getValue(*BarDecl));
         ASSERT_THAT(BarVal, NotNull());
 
         EXPECT_EQ(&BarVal->getSubVal(), FooVal);
@@ -3064,8 +3038,7 @@
         const ValueDecl *BarDecl = findValueDecl(ASTCtx, "Bar");
         ASSERT_THAT(BarDecl, NotNull());
 
-        EXPECT_EQ(Env.getValue(*FooDecl, SkipPast::None),
-                  Env.getValue(*BarDecl, SkipPast::None));
+        EXPECT_EQ(Env.getValue(*FooDecl), Env.getValue(*BarDecl));
       });
 }
 
@@ -3092,8 +3065,7 @@
         const ValueDecl *BarDecl = findValueDecl(ASTCtx, "Bar");
         ASSERT_THAT(BarDecl, NotNull());
 
-        EXPECT_EQ(Env.getValue(*FooDecl, SkipPast::None),
-                  Env.getValue(*BarDecl, SkipPast::None));
+        EXPECT_EQ(Env.getValue(*FooDecl), Env.getValue(*BarDecl));
       });
 }
 
@@ -3125,8 +3097,7 @@
         // `__builtin_unreachable` promises that the code is
         // unreachable, so the compiler treats the "then" branch as the
         // only possible predecessor of this statement.
-        EXPECT_EQ(Env.getValue(*FooDecl, SkipPast::None),
-                  Env.getValue(*BarDecl, SkipPast::None));
+        EXPECT_EQ(Env.getValue(*FooDecl), Env.getValue(*BarDecl));
       });
 }
 
@@ -3157,8 +3128,7 @@
 
         // `__builtin_trap` ensures program termination, so only the
         // "then" branch is a predecessor of this statement.
-        EXPECT_EQ(Env.getValue(*FooDecl, SkipPast::None),
-                  Env.getValue(*BarDecl, SkipPast::None));
+        EXPECT_EQ(Env.getValue(*FooDecl), Env.getValue(*BarDecl));
       });
 }
 
@@ -3188,8 +3158,7 @@
         ASSERT_THAT(BarDecl, NotNull());
 
         // `__builtin_debugtrap` doesn't ensure program termination.
-        EXPECT_NE(Env.getValue(*FooDecl, SkipPast::None),
-                  Env.getValue(*BarDecl, SkipPast::None));
+        EXPECT_NE(Env.getValue(*FooDecl), Env.getValue(*BarDecl));
       });
 }
 
@@ -3278,10 +3247,8 @@
         const ValueDecl *BazDecl = findValueDecl(ASTCtx, "Baz");
         ASSERT_THAT(BazDecl, NotNull());
 
-        const Value *BarVal =
-            cast<IntegerValue>(Env.getValue(*BarDecl, SkipPast::None));
-        const Value *BazVal =
-            cast<IntegerValue>(Env.getValue(*BazDecl, SkipPast::None));
+        const Value *BarVal = cast<IntegerValue>(Env.getValue(*BarDecl));
+        const Value *BazVal = cast<IntegerValue>(Env.getValue(*BazDecl));
         EXPECT_EQ(BarVal, BazVal);
       });
 }
@@ -3311,10 +3278,8 @@
         const ValueDecl *BazDecl = findValueDecl(ASTCtx, "Baz");
         ASSERT_THAT(BazDecl, NotNull());
 
-        const Value *BarVal =
-            cast<IntegerValue>(Env.getValue(*BarDecl, SkipPast::None));
-        const Value *BazVal =
-            cast<IntegerValue>(Env.getValue(*BazDecl, SkipPast::None));
+        const Value *BarVal = cast<IntegerValue>(Env.getValue(*BarDecl));
+        const Value *BazVal = cast<IntegerValue>(Env.getValue(*BazDecl));
         EXPECT_EQ(BarVal, BazVal);
       });
 }
@@ -3344,10 +3309,8 @@
         const ValueDecl *BazDecl = findValueDecl(ASTCtx, "Baz");
         ASSERT_THAT(BazDecl, NotNull());
 
-        const Value *BarVal =
-            cast<IntegerValue>(Env.getValue(*BarDecl, SkipPast::None));
-        const Value *BazVal =
-            cast<IntegerValue>(Env.getValue(*BazDecl, SkipPast::None));
+        const Value *BarVal = cast<IntegerValue>(Env.getValue(*BarDecl));
+        const Value *BazVal = cast<IntegerValue>(Env.getValue(*BazDecl));
         EXPECT_EQ(BarVal, BazVal);
       });
 }
@@ -3386,11 +3349,9 @@
         const ValueDecl *A2Decl = findValueDecl(ASTCtx, "A2");
         ASSERT_THAT(A2Decl, NotNull());
 
-        const auto *BarVal =
-            cast<IntegerValue>(Env.getValue(*BarDecl, SkipPast::None));
+        const auto *BarVal = cast<IntegerValue>(Env.getValue(*BarDecl));
 
-        const auto *A2Val =
-            cast<StructValue>(Env.getValue(*A2Decl, SkipPast::None));
+        const auto *A2Val = cast<StructValue>(Env.getValue(*A2Decl));
         EXPECT_EQ(A2Val->getChild(*FooDecl), BarVal);
       });
 }
@@ -3421,12 +3382,10 @@
         const ValueDecl *BarDecl = findValueDecl(ASTCtx, "Bar");
         ASSERT_THAT(BarDecl, NotNull());
 
-        auto &BarValThen =
-            *cast<BoolValue>(EnvThen.getValue(*BarDecl, SkipPast::None));
+        auto &BarValThen = *cast<BoolValue>(EnvThen.getValue(*BarDecl));
         EXPECT_TRUE(EnvThen.flowConditionImplies(BarValThen));
 
-        auto &BarValElse =
-            *cast<BoolValue>(EnvElse.getValue(*BarDecl, SkipPast::None));
+        auto &BarValElse = *cast<BoolValue>(EnvElse.getValue(*BarDecl));
         EXPECT_FALSE(EnvElse.flowConditionImplies(BarValElse));
       });
 }
@@ -3457,12 +3416,10 @@
         const ValueDecl *BarDecl = findValueDecl(ASTCtx, "Bar");
         ASSERT_THAT(BarDecl, NotNull());
 
-        auto &BarValThen =
-            *cast<BoolValue>(EnvThen.getValue(*BarDecl, SkipPast::None));
+        auto &BarValThen = *cast<BoolValue>(EnvThen.getValue(*BarDecl));
         EXPECT_FALSE(EnvThen.flowConditionImplies(BarValThen));
 
-        auto &BarValElse =
-            *cast<BoolValue>(EnvElse.getValue(*BarDecl, SkipPast::None));
+        auto &BarValElse = *cast<BoolValue>(EnvElse.getValue(*BarDecl));
         EXPECT_TRUE(EnvElse.flowConditionImplies(BarValElse));
       });
 }
@@ -3498,20 +3455,20 @@
           const Environment &Env = getEnvironmentAtAnnotation(Results, "p0");
           const ValueDecl *BDecl = findValueDecl(ASTCtx, "B");
           ASSERT_THAT(BDecl, NotNull());
-          auto &BVal = *cast<BoolValue>(Env.getValue(*BDecl, SkipPast::None));
+          auto &BVal = *cast<BoolValue>(Env.getValue(*BDecl));
 
           EXPECT_TRUE(Env.flowConditionImplies(Env.makeNot(BVal)));
         }
 
         {
           const Environment &Env = getEnvironmentAtAnnotation(Results, "p1");
-          auto &CVal = *cast<BoolValue>(Env.getValue(*CDecl, SkipPast::None));
+          auto &CVal = *cast<BoolValue>(Env.getValue(*CDecl));
           EXPECT_TRUE(Env.flowConditionImplies(CVal));
         }
 
         {
           const Environment &Env = getEnvironmentAtAnnotation(Results, "p2");
-          auto &CVal = *cast<BoolValue>(Env.getValue(*CDecl, SkipPast::None));
+          auto &CVal = *cast<BoolValue>(Env.getValue(*CDecl));
           EXPECT_TRUE(Env.flowConditionImplies(CVal));
         }
       });
@@ -3543,7 +3500,7 @@
         const ValueDecl *BarDecl = findValueDecl(ASTCtx, "Bar");
         ASSERT_THAT(BarDecl, NotNull());
 
-        auto &BarVal = *cast<BoolValue>(Env.getValue(*BarDecl, SkipPast::None));
+        auto &BarVal = *cast<BoolValue>(Env.getValue(*BarDecl));
         EXPECT_TRUE(Env.flowConditionImplies(Env.makeNot(BarVal)));
       });
 }
@@ -3575,8 +3532,8 @@
         const ValueDecl *ErrDecl = findValueDecl(ASTCtx, "Err");
         ASSERT_THAT(ErrDecl, NotNull());
 
-        auto &BarVal = *cast<BoolValue>(Env.getValue(*BarDecl, SkipPast::None));
-        auto &ErrVal = *cast<BoolValue>(Env.getValue(*ErrDecl, SkipPast::None));
+        auto &BarVal = *cast<BoolValue>(Env.getValue(*BarDecl));
+        auto &ErrVal = *cast<BoolValue>(Env.getValue(*ErrDecl));
         EXPECT_TRUE(Env.flowConditionImplies(BarVal));
         // An unsound analysis, for example only evaluating the loop once, can
         // conclude that `Err` is false. So, we test that this conclusion is not
@@ -3610,8 +3567,7 @@
         const ValueDecl *BarDecl = findValueDecl(ASTCtx, "Bar");
         ASSERT_THAT(BarDecl, NotNull());
 
-        auto &BarVal =
-            *cast<BoolValue>(Env.getValue(*BarDecl, SkipPast::Reference));
+        auto &BarVal = *cast<BoolValue>(Env.getValue(*BarDecl));
         EXPECT_TRUE(Env.flowConditionImplies(Env.makeNot(BarVal)));
       });
 }
@@ -3652,16 +3608,14 @@
         ASSERT_THAT(LDecl, NotNull());
 
         // Inner.
-        auto *LVal =
-            dyn_cast<PointerValue>(InnerEnv.getValue(*LDecl, SkipPast::None));
+        auto *LVal = dyn_cast<PointerValue>(InnerEnv.getValue(*LDecl));
         ASSERT_THAT(LVal, NotNull());
 
         EXPECT_EQ(&LVal->getPointeeLoc(),
                   InnerEnv.getStorageLocation(*ValDecl));
 
         // Outer.
-        LVal =
-            dyn_cast<PointerValue>(OuterEnv.getValue(*LDecl, SkipPast::None));
+        LVal = dyn_cast<PointerValue>(OuterEnv.getValue(*LDecl));
         ASSERT_THAT(LVal, NotNull());
 
         // The loop body may not have been executed, so we should not conclude
@@ -3738,7 +3692,7 @@
         const StorageLocation *BarRefLoc = Env.getStorageLocation(*BarRefDecl);
         ASSERT_THAT(BarRefLoc, NotNull());
 
-        const Value *QuxVal = Env.getValue(*QuxDecl, SkipPast::None);
+        const Value *QuxVal = Env.getValue(*QuxDecl);
         ASSERT_THAT(QuxVal, NotNull());
 
         const StorageLocation *BoundFooRefLoc =
@@ -3749,7 +3703,7 @@
             Env.getStorageLocation(*BoundBarRefDecl);
         EXPECT_EQ(BoundBarRefLoc, BarRefLoc);
 
-        EXPECT_EQ(Env.getValue(*BoundFooRefDecl, SkipPast::Reference), QuxVal);
+        EXPECT_EQ(Env.getValue(*BoundFooRefDecl), QuxVal);
       });
 }
 
@@ -3797,7 +3751,7 @@
         const StorageLocation *BarRefLoc = Env.getStorageLocation(*BarRefDecl);
         ASSERT_THAT(BarRefLoc, NotNull());
 
-        const Value *QuxVal = Env.getValue(*QuxDecl, SkipPast::None);
+        const Value *QuxVal = Env.getValue(*QuxDecl);
         ASSERT_THAT(QuxVal, NotNull());
 
         const StorageLocation *BoundFooRefLoc =
@@ -3808,7 +3762,7 @@
             Env.getStorageLocation(*BoundBarRefDecl);
         EXPECT_EQ(BoundBarRefLoc, BarRefLoc);
 
-        EXPECT_EQ(Env.getValue(*BoundFooRefDecl, SkipPast::Reference), QuxVal);
+        EXPECT_EQ(Env.getValue(*BoundFooRefDecl), QuxVal);
       });
 }
 
@@ -3857,7 +3811,7 @@
         const StorageLocation *BarRefLoc = Env.getStorageLocation(*BarRefDecl);
         ASSERT_THAT(BarRefLoc, NotNull());
 
-        const Value *QuxVal = Env.getValue(*QuxDecl, SkipPast::None);
+        const Value *QuxVal = Env.getValue(*QuxDecl);
         ASSERT_THAT(QuxVal, NotNull());
 
         const StorageLocation *BoundFooLoc =
@@ -3868,7 +3822,7 @@
             Env.getStorageLocation(*BoundBarDecl);
         EXPECT_NE(BoundBarLoc, BarRefLoc);
 
-        EXPECT_EQ(Env.getValue(*BoundFooDecl, SkipPast::Reference), QuxVal);
+        EXPECT_EQ(Env.getValue(*BoundFooDecl), QuxVal);
       });
 }
 
@@ -3934,24 +3888,22 @@
 
         // BindingDecls always map to references -- either lvalue or rvalue, so
         // we still need to skip here.
-        const Value *BoundFooValue =
-            Env1.getValue(*BoundFooDecl, SkipPast::Reference);
+        const Value *BoundFooValue = Env1.getValue(*BoundFooDecl);
         ASSERT_THAT(BoundFooValue, NotNull());
         EXPECT_TRUE(isa<BoolValue>(BoundFooValue));
 
-        const Value *BoundBarValue =
-            Env1.getValue(*BoundBarDecl, SkipPast::Reference);
+        const Value *BoundBarValue = Env1.getValue(*BoundBarDecl);
         ASSERT_THAT(BoundBarValue, NotNull());
         EXPECT_TRUE(isa<IntegerValue>(BoundBarValue));
 
         // Test that a `DeclRefExpr` to a `BindingDecl` works as expected.
-        EXPECT_EQ(Env1.getValue(*BazDecl, SkipPast::None), BoundFooValue);
+        EXPECT_EQ(Env1.getValue(*BazDecl), BoundFooValue);
 
         const Environment &Env2 = getEnvironmentAtAnnotation(Results, "p2");
 
         // Test that `BoundFooDecl` retains the value we expect, after the join.
-        BoundFooValue = Env2.getValue(*BoundFooDecl, SkipPast::Reference);
-        EXPECT_EQ(Env2.getValue(*BazDecl, SkipPast::None), BoundFooValue);
+        BoundFooValue = Env2.getValue(*BoundFooDecl);
+        EXPECT_EQ(Env2.getValue(*BazDecl), BoundFooValue);
       });
 }
 
@@ -4015,13 +3967,11 @@
         const ValueDecl *BazDecl = findValueDecl(ASTCtx, "Baz");
         ASSERT_THAT(BazDecl, NotNull());
 
-        const Value *BoundFooValue =
-            Env1.getValue(*BoundFooDecl, SkipPast::Reference);
+        const Value *BoundFooValue = Env1.getValue(*BoundFooDecl);
         ASSERT_THAT(BoundFooValue, NotNull());
         EXPECT_TRUE(isa<BoolValue>(BoundFooValue));
 
-        const Value *BoundBarValue =
-            Env1.getValue(*BoundBarDecl, SkipPast::Reference);
+        const Value *BoundBarValue = Env1.getValue(*BoundBarDecl);
         ASSERT_THAT(BoundBarValue, NotNull());
         EXPECT_TRUE(isa<IntegerValue>(BoundBarValue));
 
@@ -4029,13 +3979,13 @@
         // works as expected. We don't test aliasing properties of the
         // reference, because we don't model `std::get` and so have no way to
         // equate separate references into the tuple.
-        EXPECT_EQ(Env1.getValue(*BazDecl, SkipPast::None), BoundFooValue);
+        EXPECT_EQ(Env1.getValue(*BazDecl), BoundFooValue);
 
         const Environment &Env2 = getEnvironmentAtAnnotation(Results, "p2");
 
         // Test that `BoundFooDecl` retains the value we expect, after the join.
-        BoundFooValue = Env2.getValue(*BoundFooDecl, SkipPast::Reference);
-        EXPECT_EQ(Env2.getValue(*BazDecl, SkipPast::None), BoundFooValue);
+        BoundFooValue = Env2.getValue(*BoundFooDecl);
+        EXPECT_EQ(Env2.getValue(*BazDecl), BoundFooValue);
       });
 }
 
@@ -4092,12 +4042,10 @@
         const ValueDecl *FooDecl = findValueDecl(ASTCtx, "Foo");
         ASSERT_THAT(FooDecl, NotNull());
 
-        BoolValue &ThenFooVal =
-            *cast<BoolValue>(ThenEnv.getValue(*FooDecl, SkipPast::None));
+        BoolValue &ThenFooVal = *cast<BoolValue>(ThenEnv.getValue(*FooDecl));
         EXPECT_TRUE(ThenEnv.flowConditionImplies(ThenFooVal));
 
-        BoolValue &ElseFooVal =
-            *cast<BoolValue>(ElseEnv.getValue(*FooDecl, SkipPast::None));
+        BoolValue &ElseFooVal = *cast<BoolValue>(ElseEnv.getValue(*FooDecl));
         EXPECT_TRUE(ElseEnv.flowConditionImplies(ElseEnv.makeNot(ElseFooVal)));
       });
 }
@@ -4128,11 +4076,11 @@
         ASSERT_THAT(FooDecl, NotNull());
 
         BoolValue &LoopBodyFooVal =
-            *cast<BoolValue>(LoopBodyEnv.getValue(*FooDecl, SkipPast::None));
+            *cast<BoolValue>(LoopBodyEnv.getValue(*FooDecl));
         EXPECT_TRUE(LoopBodyEnv.flowConditionImplies(LoopBodyFooVal));
 
         BoolValue &AfterLoopFooVal =
-            *cast<BoolValue>(AfterLoopEnv.getValue(*FooDecl, SkipPast::None));
+            *cast<BoolValue>(AfterLoopEnv.getValue(*FooDecl));
         EXPECT_TRUE(AfterLoopEnv.flowConditionImplies(
             AfterLoopEnv.makeNot(AfterLoopFooVal)));
       });
@@ -4169,16 +4117,16 @@
         ASSERT_THAT(BarDecl, NotNull());
 
         BoolValue &LoopBodyFooVal =
-            *cast<BoolValue>(LoopBodyEnv.getValue(*FooDecl, SkipPast::None));
+            *cast<BoolValue>(LoopBodyEnv.getValue(*FooDecl));
         BoolValue &LoopBodyBarVal =
-            *cast<BoolValue>(LoopBodyEnv.getValue(*BarDecl, SkipPast::None));
+            *cast<BoolValue>(LoopBodyEnv.getValue(*BarDecl));
         EXPECT_TRUE(LoopBodyEnv.flowConditionImplies(
             LoopBodyEnv.makeOr(LoopBodyBarVal, LoopBodyFooVal)));
 
         BoolValue &AfterLoopFooVal =
-            *cast<BoolValue>(AfterLoopEnv.getValue(*FooDecl, SkipPast::None));
+            *cast<BoolValue>(AfterLoopEnv.getValue(*FooDecl));
         BoolValue &AfterLoopBarVal =
-            *cast<BoolValue>(AfterLoopEnv.getValue(*BarDecl, SkipPast::None));
+            *cast<BoolValue>(AfterLoopEnv.getValue(*BarDecl));
         EXPECT_TRUE(AfterLoopEnv.flowConditionImplies(
             AfterLoopEnv.makeNot(AfterLoopFooVal)));
         EXPECT_TRUE(AfterLoopEnv.flowConditionImplies(
@@ -4212,11 +4160,11 @@
         ASSERT_THAT(FooDecl, NotNull());
 
         BoolValue &LoopBodyFooVal =
-            *cast<BoolValue>(LoopBodyEnv.getValue(*FooDecl, SkipPast::None));
+            *cast<BoolValue>(LoopBodyEnv.getValue(*FooDecl));
         EXPECT_TRUE(LoopBodyEnv.flowConditionImplies(LoopBodyFooVal));
 
         BoolValue &AfterLoopFooVal =
-            *cast<BoolValue>(AfterLoopEnv.getValue(*FooDecl, SkipPast::None));
+            *cast<BoolValue>(AfterLoopEnv.getValue(*FooDecl));
         EXPECT_TRUE(AfterLoopEnv.flowConditionImplies(
             AfterLoopEnv.makeNot(AfterLoopFooVal)));
       });
@@ -4243,7 +4191,7 @@
         ASSERT_THAT(FooDecl, NotNull());
 
         BoolValue &LoopBodyFooVal =
-            *cast<BoolValue>(LoopBodyEnv.getValue(*FooDecl, SkipPast::None));
+            *cast<BoolValue>(LoopBodyEnv.getValue(*FooDecl));
         EXPECT_FALSE(LoopBodyEnv.flowConditionImplies(LoopBodyFooVal));
       });
 }
@@ -4269,7 +4217,7 @@
         const ValueDecl *FooDecl = findValueDecl(ASTCtx, "Foo");
         ASSERT_THAT(FooDecl, NotNull());
 
-        auto &FooVal = *cast<BoolValue>(Env.getValue(*FooDecl, SkipPast::None));
+        auto &FooVal = *cast<BoolValue>(Env.getValue(*FooDecl));
         EXPECT_FALSE(Env.flowConditionImplies(FooVal));
         EXPECT_FALSE(Env.flowConditionImplies(Env.makeNot(FooVal)));
       },
@@ -4326,7 +4274,7 @@
         const ValueDecl *FooDecl = findValueDecl(ASTCtx, "Foo");
         ASSERT_THAT(FooDecl, NotNull());
 
-        auto &FooVal = *cast<BoolValue>(Env.getValue(*FooDecl, SkipPast::None));
+        auto &FooVal = *cast<BoolValue>(Env.getValue(*FooDecl));
         EXPECT_FALSE(Env.flowConditionImplies(FooVal));
         EXPECT_FALSE(Env.flowConditionImplies(Env.makeNot(FooVal)));
       },
@@ -4354,7 +4302,7 @@
         const ValueDecl *FooDecl = findValueDecl(ASTCtx, "Foo");
         ASSERT_THAT(FooDecl, NotNull());
 
-        auto &FooVal = *cast<BoolValue>(Env.getValue(*FooDecl, SkipPast::None));
+        auto &FooVal = *cast<BoolValue>(Env.getValue(*FooDecl));
         EXPECT_TRUE(Env.flowConditionImplies(FooVal));
       },
       {BuiltinOptions{ContextSensitiveOptions{}}});
@@ -4381,7 +4329,7 @@
         const ValueDecl *FooDecl = findValueDecl(ASTCtx, "Foo");
         ASSERT_THAT(FooDecl, NotNull());
 
-        auto &FooVal = *cast<BoolValue>(Env.getValue(*FooDecl, SkipPast::None));
+        auto &FooVal = *cast<BoolValue>(Env.getValue(*FooDecl));
         EXPECT_TRUE(Env.flowConditionImplies(Env.makeNot(FooVal)));
       },
       {BuiltinOptions{ContextSensitiveOptions{}}});
@@ -4413,11 +4361,11 @@
         const ValueDecl *BarDecl = findValueDecl(ASTCtx, "Bar");
         ASSERT_THAT(BarDecl, NotNull());
 
-        auto &FooVal = *cast<BoolValue>(Env.getValue(*FooDecl, SkipPast::None));
+        auto &FooVal = *cast<BoolValue>(Env.getValue(*FooDecl));
         EXPECT_TRUE(Env.flowConditionImplies(FooVal));
         EXPECT_FALSE(Env.flowConditionImplies(Env.makeNot(FooVal)));
 
-        auto &BarVal = *cast<BoolValue>(Env.getValue(*BarDecl, SkipPast::None));
+        auto &BarVal = *cast<BoolValue>(Env.getValue(*BarDecl));
         EXPECT_FALSE(Env.flowConditionImplies(BarVal));
         EXPECT_TRUE(Env.flowConditionImplies(Env.makeNot(BarVal)));
       },
@@ -4446,7 +4394,7 @@
         const ValueDecl *FooDecl = findValueDecl(ASTCtx, "Foo");
         ASSERT_THAT(FooDecl, NotNull());
 
-        auto &FooVal = *cast<BoolValue>(Env.getValue(*FooDecl, SkipPast::None));
+        auto &FooVal = *cast<BoolValue>(Env.getValue(*FooDecl));
         EXPECT_FALSE(Env.flowConditionImplies(FooVal));
         EXPECT_FALSE(Env.flowConditionImplies(Env.makeNot(FooVal)));
       },
@@ -4475,7 +4423,7 @@
         const ValueDecl *FooDecl = findValueDecl(ASTCtx, "Foo");
         ASSERT_THAT(FooDecl, NotNull());
 
-        auto &FooVal = *cast<BoolValue>(Env.getValue(*FooDecl, SkipPast::None));
+        auto &FooVal = *cast<BoolValue>(Env.getValue(*FooDecl));
         EXPECT_TRUE(Env.flowConditionImplies(FooVal));
       },
       {BuiltinOptions{ContextSensitiveOptions{/*.Depth=*/2}}});
@@ -4504,7 +4452,7 @@
         const ValueDecl *FooDecl = findValueDecl(ASTCtx, "Foo");
         ASSERT_THAT(FooDecl, NotNull());
 
-        auto &FooVal = *cast<BoolValue>(Env.getValue(*FooDecl, SkipPast::None));
+        auto &FooVal = *cast<BoolValue>(Env.getValue(*FooDecl));
         EXPECT_FALSE(Env.flowConditionImplies(FooVal));
         EXPECT_FALSE(Env.flowConditionImplies(Env.makeNot(FooVal)));
       },
@@ -4534,7 +4482,7 @@
         const ValueDecl *FooDecl = findValueDecl(ASTCtx, "Foo");
         ASSERT_THAT(FooDecl, NotNull());
 
-        auto &FooVal = *cast<BoolValue>(Env.getValue(*FooDecl, SkipPast::None));
+        auto &FooVal = *cast<BoolValue>(Env.getValue(*FooDecl));
         EXPECT_TRUE(Env.flowConditionImplies(FooVal));
       },
       {BuiltinOptions{ContextSensitiveOptions{/*.Depth=*/3}}});
@@ -4576,7 +4524,7 @@
         const ValueDecl *FooDecl = findValueDecl(ASTCtx, "Foo");
         ASSERT_THAT(FooDecl, NotNull());
 
-        auto &FooVal = *cast<BoolValue>(Env.getValue(*FooDecl, SkipPast::None));
+        auto &FooVal = *cast<BoolValue>(Env.getValue(*FooDecl));
         // ... but it also can't prove anything here.
         EXPECT_FALSE(Env.flowConditionImplies(FooVal));
         EXPECT_FALSE(Env.flowConditionImplies(Env.makeNot(FooVal)));
@@ -4611,11 +4559,11 @@
         const ValueDecl *BarDecl = findValueDecl(ASTCtx, "Bar");
         ASSERT_THAT(BarDecl, NotNull());
 
-        auto &FooVal = *cast<BoolValue>(Env.getValue(*FooDecl, SkipPast::None));
+        auto &FooVal = *cast<BoolValue>(Env.getValue(*FooDecl));
         EXPECT_TRUE(Env.flowConditionImplies(FooVal));
         EXPECT_FALSE(Env.flowConditionImplies(Env.makeNot(FooVal)));
 
-        auto &BarVal = *cast<BoolValue>(Env.getValue(*BarDecl, SkipPast::None));
+        auto &BarVal = *cast<BoolValue>(Env.getValue(*BarDecl));
         EXPECT_FALSE(Env.flowConditionImplies(BarVal));
         EXPECT_TRUE(Env.flowConditionImplies(Env.makeNot(BarVal)));
       },
@@ -4653,11 +4601,11 @@
         const ValueDecl *BazDecl = findValueDecl(ASTCtx, "Baz");
         ASSERT_THAT(BazDecl, NotNull());
 
-        auto &BarVal = *cast<BoolValue>(Env.getValue(*BarDecl, SkipPast::None));
+        auto &BarVal = *cast<BoolValue>(Env.getValue(*BarDecl));
         EXPECT_FALSE(Env.flowConditionImplies(BarVal));
         EXPECT_TRUE(Env.flowConditionImplies(Env.makeNot(BarVal)));
 
-        auto &BazVal = *cast<BoolValue>(Env.getValue(*BazDecl, SkipPast::None));
+        auto &BazVal = *cast<BoolValue>(Env.getValue(*BazDecl));
         EXPECT_TRUE(Env.flowConditionImplies(BazVal));
         EXPECT_FALSE(Env.flowConditionImplies(Env.makeNot(BazVal)));
       },
@@ -4702,7 +4650,7 @@
         const ValueDecl *FooDecl = findValueDecl(ASTCtx, "Foo");
         ASSERT_THAT(FooDecl, NotNull());
 
-        auto &FooVal = *cast<BoolValue>(Env.getValue(*FooDecl, SkipPast::None));
+        auto &FooVal = *cast<BoolValue>(Env.getValue(*FooDecl));
         EXPECT_TRUE(Env.flowConditionImplies(FooVal));
       },
       {BuiltinOptions{ContextSensitiveOptions{}}});
@@ -4727,7 +4675,7 @@
         const ValueDecl *FooDecl = findValueDecl(ASTCtx, "Foo");
         ASSERT_THAT(FooDecl, NotNull());
 
-        auto &FooVal = *cast<BoolValue>(Env.getValue(*FooDecl, SkipPast::None));
+        auto &FooVal = *cast<BoolValue>(Env.getValue(*FooDecl));
         EXPECT_TRUE(Env.flowConditionImplies(Env.makeNot(FooVal)));
       },
       {BuiltinOptions{ContextSensitiveOptions{}}});
@@ -4755,7 +4703,7 @@
         const ValueDecl *BazDecl = findValueDecl(ASTCtx, "Baz");
         ASSERT_THAT(BazDecl, NotNull());
 
-        auto &BazVal = *cast<BoolValue>(Env.getValue(*BazDecl, SkipPast::None));
+        auto &BazVal = *cast<BoolValue>(Env.getValue(*BazDecl));
         EXPECT_TRUE(Env.flowConditionImplies(BazVal));
       },
       {BuiltinOptions{ContextSensitiveOptions{}}});
@@ -4803,7 +4751,7 @@
         const ValueDecl *FooDecl = findValueDecl(ASTCtx, "Foo");
         ASSERT_THAT(FooDecl, NotNull());
 
-        auto &FooVal = *cast<BoolValue>(Env.getValue(*FooDecl, SkipPast::None));
+        auto &FooVal = *cast<BoolValue>(Env.getValue(*FooDecl));
         EXPECT_TRUE(Env.flowConditionImplies(FooVal));
       },
       {BuiltinOptions{ContextSensitiveOptions{}}});
@@ -4835,7 +4783,7 @@
         const ValueDecl *FooDecl = findValueDecl(ASTCtx, "Foo");
         ASSERT_THAT(FooDecl, NotNull());
 
-        auto &FooVal = *cast<BoolValue>(Env.getValue(*FooDecl, SkipPast::None));
+        auto &FooVal = *cast<BoolValue>(Env.getValue(*FooDecl));
         EXPECT_TRUE(Env.flowConditionImplies(FooVal));
       },
       {BuiltinOptions{ContextSensitiveOptions{}}});
@@ -4867,7 +4815,7 @@
         const ValueDecl *FooDecl = findValueDecl(ASTCtx, "Foo");
         ASSERT_THAT(FooDecl, NotNull());
 
-        auto &FooVal = *cast<BoolValue>(Env.getValue(*FooDecl, SkipPast::None));
+        auto &FooVal = *cast<BoolValue>(Env.getValue(*FooDecl));
         EXPECT_TRUE(Env.flowConditionImplies(FooVal));
       },
       {BuiltinOptions{ContextSensitiveOptions{}}});
@@ -4901,7 +4849,7 @@
         const ValueDecl *FooDecl = findValueDecl(ASTCtx, "Foo");
         ASSERT_THAT(FooDecl, NotNull());
 
-        auto &FooVal = *cast<BoolValue>(Env.getValue(*FooDecl, SkipPast::None));
+        auto &FooVal = *cast<BoolValue>(Env.getValue(*FooDecl));
         EXPECT_TRUE(Env.flowConditionImplies(FooVal));
       },
       {BuiltinOptions{ContextSensitiveOptions{}}});
@@ -4936,7 +4884,7 @@
         const ValueDecl *FooDecl = findValueDecl(ASTCtx, "Foo");
         ASSERT_THAT(FooDecl, NotNull());
 
-        auto &FooVal = *cast<BoolValue>(Env.getValue(*FooDecl, SkipPast::None));
+        auto &FooVal = *cast<BoolValue>(Env.getValue(*FooDecl));
         EXPECT_TRUE(Env.flowConditionImplies(FooVal));
       },
       {BuiltinOptions{ContextSensitiveOptions{}}});
@@ -4970,7 +4918,7 @@
         const ValueDecl *FooDecl = findValueDecl(ASTCtx, "Foo");
         ASSERT_THAT(FooDecl, NotNull());
 
-        auto &FooVal = *cast<BoolValue>(Env.getValue(*FooDecl, SkipPast::None));
+        auto &FooVal = *cast<BoolValue>(Env.getValue(*FooDecl));
         EXPECT_TRUE(Env.flowConditionImplies(FooVal));
       },
       {BuiltinOptions{ContextSensitiveOptions{}}});
@@ -5001,7 +4949,7 @@
         const ValueDecl *FooDecl = findValueDecl(ASTCtx, "Foo");
         ASSERT_THAT(FooDecl, NotNull());
 
-        auto &FooVal = *cast<BoolValue>(Env.getValue(*FooDecl, SkipPast::None));
+        auto &FooVal = *cast<BoolValue>(Env.getValue(*FooDecl));
         EXPECT_TRUE(Env.flowConditionImplies(FooVal));
       },
       {BuiltinOptions{ContextSensitiveOptions{}}});
@@ -5032,7 +4980,7 @@
         const ValueDecl *FooDecl = findValueDecl(ASTCtx, "Foo");
         ASSERT_THAT(FooDecl, NotNull());
 
-        auto &FooVal = *cast<BoolValue>(Env.getValue(*FooDecl, SkipPast::None));
+        auto &FooVal = *cast<BoolValue>(Env.getValue(*FooDecl));
         EXPECT_TRUE(Env.flowConditionImplies(FooVal));
       },
       {BuiltinOptions{ContextSensitiveOptions{}}});
@@ -5063,7 +5011,7 @@
         const ValueDecl *FooDecl = findValueDecl(ASTCtx, "Foo");
         ASSERT_THAT(FooDecl, NotNull());
 
-        auto &FooVal = *cast<BoolValue>(Env.getValue(*FooDecl, SkipPast::None));
+        auto &FooVal = *cast<BoolValue>(Env.getValue(*FooDecl));
         EXPECT_TRUE(Env.flowConditionImplies(FooVal));
       },
       {BuiltinOptions{ContextSensitiveOptions{}}});
Index: clang/unittests/Analysis/FlowSensitive/TestingSupport.h
===================================================================
--- clang/unittests/Analysis/FlowSensitive/TestingSupport.h
+++ clang/unittests/Analysis/FlowSensitive/TestingSupport.h
@@ -400,7 +400,7 @@
                         llvm::StringRef Name) {
   const ValueDecl *VD = findValueDecl(ASTCtx, Name);
   assert(VD != nullptr);
-  return *cast<ValueT>(Env.getValue(*VD, SkipPast::None));
+  return *cast<ValueT>(Env.getValue(*VD));
 }
 
 /// Creates and owns constraints which are boolean values.
Index: clang/unittests/Analysis/FlowSensitive/SignAnalysisTest.cpp
===================================================================
--- clang/unittests/Analysis/FlowSensitive/SignAnalysisTest.cpp
+++ clang/unittests/Analysis/FlowSensitive/SignAnalysisTest.cpp
@@ -109,7 +109,7 @@
   // The DeclRefExpr refers to this variable in the operand.
   const auto *OperandVar = M.Nodes.getNodeAs<clang::VarDecl>(kVar);
   assert(OperandVar != nullptr);
-  const auto *OperandValue = State.Env.getValue(*OperandVar, SkipPast::None);
+  const auto *OperandValue = State.Env.getValue(*OperandVar);
   if (!OperandValue)
     return {nullptr, {}, {}};
 
Index: clang/unittests/Analysis/FlowSensitive/DataflowEnvironmentTest.cpp
===================================================================
--- clang/unittests/Analysis/FlowSensitive/DataflowEnvironmentTest.cpp
+++ clang/unittests/Analysis/FlowSensitive/DataflowEnvironmentTest.cpp
@@ -124,7 +124,7 @@
 
   // Verify the global variable is populated when we analyze `Target`.
   Environment Env(DAContext, *Fun);
-  EXPECT_THAT(Env.getValue(*Var, SkipPast::None), NotNull());
+  EXPECT_THAT(Env.getValue(*Var), NotNull());
 }
 
 // Tests that fields mentioned only in default member initializers are included
@@ -255,7 +255,7 @@
 
   // Verify the global variable is populated when we analyze `Target`.
   Environment Env(DAContext, *Ctor);
-  EXPECT_THAT(Env.getValue(*Var, SkipPast::None), NotNull());
+  EXPECT_THAT(Env.getValue(*Var), NotNull());
 }
 
 } // namespace
Index: clang/unittests/Analysis/FlowSensitive/ChromiumCheckModelTest.cpp
===================================================================
--- clang/unittests/Analysis/FlowSensitive/ChromiumCheckModelTest.cpp
+++ clang/unittests/Analysis/FlowSensitive/ChromiumCheckModelTest.cpp
@@ -158,7 +158,7 @@
         const ValueDecl *FooDecl = findValueDecl(ASTCtx, "Foo");
         ASSERT_THAT(FooDecl, NotNull());
 
-        auto *FooVal = cast<BoolValue>(Env.getValue(*FooDecl, SkipPast::None));
+        auto *FooVal = cast<BoolValue>(Env.getValue(*FooDecl));
 
         EXPECT_TRUE(Env.flowConditionImplies(*FooVal));
       };
@@ -189,7 +189,7 @@
         const ValueDecl *FooDecl = findValueDecl(ASTCtx, "Foo");
         ASSERT_THAT(FooDecl, NotNull());
 
-        auto *FooVal = cast<BoolValue>(Env.getValue(*FooDecl, SkipPast::None));
+        auto *FooVal = cast<BoolValue>(Env.getValue(*FooDecl));
 
         EXPECT_FALSE(Env.flowConditionImplies(*FooVal));
       };
Index: clang/lib/Analysis/FlowSensitive/DataflowEnvironment.cpp
===================================================================
--- clang/lib/Analysis/FlowSensitive/DataflowEnvironment.cpp
+++ clang/lib/Analysis/FlowSensitive/DataflowEnvironment.cpp
@@ -680,9 +680,7 @@
   return It == LocToVal.end() ? nullptr : It->second;
 }
 
-Value *Environment::getValue(const ValueDecl &D, SkipPast SP) const {
-  assert(SP != SkipPast::ReferenceThenPointer);
-
+Value *Environment::getValue(const ValueDecl &D) const {
   auto *Loc = getStorageLocation(D);
   if (Loc == nullptr)
     return nullptr;
Index: clang/include/clang/Analysis/FlowSensitive/DataflowEnvironment.h
===================================================================
--- clang/include/clang/Analysis/FlowSensitive/DataflowEnvironment.h
+++ clang/include/clang/Analysis/FlowSensitive/DataflowEnvironment.h
@@ -326,11 +326,7 @@
 
   /// Equivalent to `getValue(getStorageLocation(D, SP), SkipPast::None)` if `D`
   /// is assigned a storage location in the environment, otherwise returns null.
-  ///
-  /// The `SP` parameter is deprecated and has no effect. In addition, it is
-  /// not permitted to pass `SkipPast::ReferenceThenPointer` for this parameter.
-  /// New uses of this function should use the default argument for `SP`.
-  Value *getValue(const ValueDecl &D, SkipPast SP = SkipPast::None) const;
+  Value *getValue(const ValueDecl &D) const;
 
   /// Equivalent to `getValue(getStorageLocation(E, SP), SkipPast::None)` if `E`
   /// is assigned a storage location in the environment, otherwise returns null.
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
  • [PATCH] D150137: [clang... Martin Böhme via Phabricator via cfe-commits

Reply via email to