Skip to content

Commit

Permalink
[clang][dataflow] Use Strict accessors in comma operator and no-op …
Browse files Browse the repository at this point in the history
…cast.

This patch is part of the ongoing migration to strict handling of value
categories (see https://discourse.llvm.org/t/70086 for details).

Depends On D150775

Reviewed By: gribozavr2

Differential Revision: https://reviews.llvm.org/D150776
  • Loading branch information
martinboehme committed May 23, 2023
1 parent 75cce50 commit 68baaca
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions clang/lib/Analysis/FlowSensitive/Transfer.cpp
Expand Up @@ -224,8 +224,7 @@ class TransferVisitor : public ConstStmtVisitor<TransferVisitor> {
break;
}
case BO_Comma: {
if (auto *Loc = Env.getStorageLocation(*RHS, SkipPast::None))
Env.setStorageLocation(*S, *Loc);
propagateValueOrStorageLocation(*RHS, *S, Env);
break;
}
default:
Expand Down Expand Up @@ -397,13 +396,9 @@ class TransferVisitor : public ConstStmtVisitor<TransferVisitor> {
// CK_ConstructorConversion, and CK_UserDefinedConversion.
case CK_NoOp: {
// FIXME: Consider making `Environment::getStorageLocation` skip noop
// expressions (this and other similar expressions in the file) instead of
// assigning them storage locations.
auto *SubExprLoc = Env.getStorageLocation(*SubExpr, SkipPast::None);
if (SubExprLoc == nullptr)
break;

Env.setStorageLocation(*S, *SubExprLoc);
// expressions (this and other similar expressions in the file) instead
// of assigning them storage locations.
propagateValueOrStorageLocation(*SubExpr, *S, Env);
break;
}
case CK_NullToPointer:
Expand Down

0 comments on commit 68baaca

Please sign in to comment.