Skip to content

Commit

Permalink
[clang][dataflow] Avoid -Wunused-variable.
Browse files Browse the repository at this point in the history
  • Loading branch information
martinboehme committed Jul 28, 2023
1 parent e56bf13 commit 8c0acbf
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions clang/lib/Analysis/FlowSensitive/DataflowEnvironment.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -686,9 +686,11 @@ void Environment::setValueStrict(const Expr &E, Value &Val) {
assert(E.isPRValue());

if (auto *StructVal = dyn_cast<StructValue>(&Val)) {
if (auto *ExistingVal = cast_or_null<StructValue>(getValue(E)))
if ([[maybe_unused]] auto *ExistingVal =
cast_or_null<StructValue>(getValue(E)))
assert(&ExistingVal->getAggregateLoc() == &StructVal->getAggregateLoc());
if (StorageLocation *ExistingLoc = getStorageLocation(E, SkipPast::None))
if ([[maybe_unused]] StorageLocation *ExistingLoc =
getStorageLocation(E, SkipPast::None))
assert(ExistingLoc == &StructVal->getAggregateLoc());
else
setStorageLocation(E, StructVal->getAggregateLoc());
Expand Down

0 comments on commit 8c0acbf

Please sign in to comment.