[PATCH] D135397: [clang][dataflow] Add support for a Top value in boolean formulas.

Gábor Horváth via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Oct 6 15:16:35 PDT 2022


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


================
Comment at: clang/unittests/Analysis/FlowSensitive/TypeErasedDataflowAnalysisTest.cpp:527-528
+    auto *Prop2 = Val2.getProperty("has_value");
+    return Prop1 == Prop2 || (Prop1 != nullptr && Prop2 != nullptr &&
+                              isTop(*Prop1) && isTop(*Prop2));
   }
----------------
I feel like this logic is repeated multiple times. I wonder if we should define an `operator==` for `const BoolValue*`.


================
Comment at: clang/unittests/Analysis/FlowSensitive/TypeErasedDataflowAnalysisTest.cpp:1192
+                         const Environment &Env1, const Value &Val2,
+                         const Environment &Env2) final {
+    // Changes to a sounds approximation, which allows us to test whether we can
----------------
Nit: I usually prefer marking whole classes final rather than individual virtual methods, but feel free to leave as is.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D135397



More information about the cfe-commits mailing list