[PATCH] D127312: [clang][dataflow] Remove IndirectionValue class, moving PointeeLoc field into PointerValue and ReferenceValue

Dmitri Gribenko via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jun 8 16:14:31 PDT 2022


gribozavr2 accepted this revision.
gribozavr2 added inline comments.
This revision is now accepted and ready to land.


================
Comment at: clang/lib/Analysis/FlowSensitive/DataflowEnvironment.cpp:63
-    auto *IndVal2 = cast<IndirectionValue>(Val2);
-    assert(IndVal1->getKind() == IndVal2->getKind());
-    if (&IndVal1->getPointeeLoc() == &IndVal2->getPointeeLoc())
----------------
wyt wrote:
> gribozavr2 wrote:
> > This assert was lost in the new implementation.
> The assertion was to ensure that the values were either both Reference or both Pointer, as an IndirectionValue could be either. 
> Since we've removed IndirectionVal and have separate casts for ReferenceVal/PointerVal, the assertion is not neccessary.
Ah I see, the `cast` now plays the role of the assert.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D127312/new/

https://reviews.llvm.org/D127312



More information about the cfe-commits mailing list