Skip to content

Commit

Permalink
[clang][dataflow][NFC] Remove obsolete references to ReferenceValue
Browse files Browse the repository at this point in the history
… from comments.

`ReferenceValue` was removed in https://reviews.llvm.org/D155922.

Reviewed By: xazax.hun

Differential Revision: https://reviews.llvm.org/D159090
  • Loading branch information
martinboehme committed Aug 30, 2023
1 parent d099dbb commit 6eb1b23
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 17 deletions.
11 changes: 0 additions & 11 deletions clang/include/clang/Analysis/FlowSensitive/DataflowEnvironment.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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;
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions clang/include/clang/Analysis/FlowSensitive/Value.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
3 changes: 1 addition & 2 deletions clang/lib/Analysis/FlowSensitive/Transfer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -276,8 +276,7 @@ class TransferVisitor : public ConstStmtVisitor<TransferVisitor> {

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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 6eb1b23

Please sign in to comment.