sgatev added a comment.

Mentioned the breaking interface change in the description.



================
Comment at: clang/lib/Analysis/FlowSensitive/DataflowEnvironment.cpp:151
 
-    if (auto *FirstVal = dyn_cast<PointerValue>(Val)) {
-      auto *SecondVal = cast<PointerValue>(It->second);
-      if (&FirstVal->getPointeeLoc() == &SecondVal->getPointeeLoc()) {
-        LocToVal.insert({Loc, FirstVal});
+    if (auto *Val1 = dyn_cast<PointerValue>(Val)) {
+      auto *Val2 = cast<PointerValue>(It->second);
----------------
xazax.hun wrote:
> Now we have multiple, slightly different versions of equality for values. One 
> here, one in `Environment::equivalentTo`. I'd prefer to have one way to check 
> value equality factored out somewhere and reused it both here and there. 
> Also, `Environment::equivalentTo` works with any indirection, this snippet 
> only works with pointers (and not with references).
> 
> It is also not clear to me at this point what is the role of 
> `compareEquivalent`. Is it intentional that it is not used here?
Good point, I updated the code. Please take a look.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D118596

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to