diff --git a/clang/include/clang/Analysis/FlowSensitive/DataflowEnvironment.h b/clang/include/clang/Analysis/FlowSensitive/DataflowEnvironment.h index 95514d940c3f6..f5e4057f957a9 100644 --- a/clang/include/clang/Analysis/FlowSensitive/DataflowEnvironment.h +++ b/clang/include/clang/Analysis/FlowSensitive/DataflowEnvironment.h @@ -254,17 +254,10 @@ class Environment { /// Requirements: /// /// `D` must not already have a storage location in the environment. - /// - /// If `D` has reference type, `Loc` must refer directly to the referenced - /// object (if any), not to a `ReferenceValue`, and it is not permitted to - /// later change `Loc` to refer to a `ReferenceValue.` void setStorageLocation(const ValueDecl &D, StorageLocation &Loc); /// Returns the storage location assigned to `D` in the environment, or null /// if `D` isn't assigned a storage location in the environment. - /// - /// Note that if `D` has reference type, the storage location that is returned - /// refers directly to the referenced object, not a `ReferenceValue`. StorageLocation *getStorageLocation(const ValueDecl &D) const; /// Assigns `Loc` as the storage location of the glvalue `E` in the @@ -280,9 +273,6 @@ class Environment { /// environment, or null if `E` isn't assigned a storage location in the /// environment. /// - /// If the storage location for `E` is associated with a - /// `ReferenceValue RefVal`, returns `RefVal.getReferentLoc()` instead. - /// /// Requirements: /// `E` must be a glvalue or a `BuiltinType::BuiltinFn` StorageLocation *getStorageLocation(const Expr &E) const; @@ -437,7 +427,6 @@ class Environment { /// Requirements: /// /// `E` must be a prvalue - /// `Val` must not be a `ReferenceValue` /// If `Val` is a `RecordValue`, its `RecordStorageLocation` must be the /// same as that of any `RecordValue` that has already been associated with /// `E`. This is to guarantee that the result object initialized by a prvalue diff --git a/clang/include/clang/Analysis/FlowSensitive/Value.h b/clang/include/clang/Analysis/FlowSensitive/Value.h index b2f71de593f99..da9fe6be9489c 100644 --- a/clang/include/clang/Analysis/FlowSensitive/Value.h +++ b/clang/include/clang/Analysis/FlowSensitive/Value.h @@ -83,8 +83,8 @@ class Value { /// transitivity. It does *not* include comparison of `Properties`. /// /// Computes equivalence for these subclasses: -/// * ReferenceValue, PointerValue -- pointee locations are equal. Does not -/// compute deep equality of `Value` at said location. +/// * PointerValue -- pointee locations are equal. Does not compute deep +/// equality of `Value` at said location. /// * TopBoolValue -- both are `TopBoolValue`s. /// /// Otherwise, falls back to pointer equality. diff --git a/clang/lib/Analysis/FlowSensitive/Transfer.cpp b/clang/lib/Analysis/FlowSensitive/Transfer.cpp index c0092694ef385..fcd9b20027cde 100644 --- a/clang/lib/Analysis/FlowSensitive/Transfer.cpp +++ b/clang/lib/Analysis/FlowSensitive/Transfer.cpp @@ -276,8 +276,7 @@ class TransferVisitor : public ConstStmtVisitor { case CK_LValueToRValue: { // When an L-value is used as an R-value, it may result in sharing, so we - // need to unpack any nested `Top`s. We also need to strip off the - // `ReferenceValue` associated with the lvalue. + // need to unpack any nested `Top`s. auto *SubExprVal = maybeUnpackLValueExpr(*SubExpr, Env); if (SubExprVal == nullptr) break; diff --git a/clang/unittests/Analysis/FlowSensitive/TypeErasedDataflowAnalysisTest.cpp b/clang/unittests/Analysis/FlowSensitive/TypeErasedDataflowAnalysisTest.cpp index de0b5c7b23905..01162c89a36c8 100644 --- a/clang/unittests/Analysis/FlowSensitive/TypeErasedDataflowAnalysisTest.cpp +++ b/clang/unittests/Analysis/FlowSensitive/TypeErasedDataflowAnalysisTest.cpp @@ -153,9 +153,9 @@ TEST(DataflowAnalysisTest, NonConvergingAnalysis) { // Regression test for joins of bool-typed lvalue expressions. The first loop // results in two passes through the code that follows. Each pass results in a -// different `ReferenceValue` for the pointee of `v`. Then, the second loop +// different `StorageLocation` for the pointee of `v`. Then, the second loop // causes a join at the loop head where the two environments map expresssion -// `*v` to different `ReferenceValue`s. +// `*v` to different `StorageLocation`s. // // An earlier version crashed for this condition (for boolean-typed lvalues), so // this test only verifies that the analysis runs successfully, without