sgatev added inline comments.

================
Comment at: 
clang/lib/Analysis/FlowSensitive/TypeErasedDataflowAnalysis.cpp:112-113
         cast_or_null<BoolValue>(Env.getValue(Cond, SkipPast::Reference));
-    if (Val == nullptr)
-      return;
+    // Value merging depends on flow conditions from different environments
+    // being mutually exclusive. So, we need *some* value for the condition
+    // expression, even if just an atom.
----------------
What does it mean for flow conditions to be mutually exclusive? Why is this a 
requirement?


================
Comment at: 
clang/lib/Analysis/FlowSensitive/TypeErasedDataflowAnalysis.cpp:123-136
+      } else if (auto *CondVal = cast_or_null<ReferenceValue>(
+                     Env.getValue(Cond, SkipPast::None))) {
+        Env.setValue(CondVal->getPointeeLoc(), *Val);
+      } else {
+        QualType PointeeType = Type->castAs<ReferenceType>()->getPointeeType();
+        StorageLocation &PointeeLoc = Env.createStorageLocation(PointeeType);
+        Env.setValue(PointeeLoc, *Val);
----------------
Let's also add tests for these two paths.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D123858

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

Reply via email to