[PATCH] D103314: [Analyzer][solver] Simplify existing constraints when a new constraint is added

Gabor Marton via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jun 9 11:52:22 PDT 2021


martong marked an inline comment as done.
martong added inline comments.


================
Comment at: clang/lib/StaticAnalyzer/Core/RangeConstraintManager.cpp:1789
+  if (DisequalToOther.contains(*this))
+    return nullptr;
   if (!DisequalToOther.isEmpty()) {
----------------
vsavchenko wrote:
> very opinionated nit: can you please add extra new line after this?
Sure.


================
Comment at: clang/lib/StaticAnalyzer/Core/RangeConstraintManager.cpp:1976-1986
+      Optional<bool> KnownClassEquality =
+          isEqualTo(State, ClassOfSimplifiedSym);
+      if (KnownClassEquality) {
+        // The classes are already equal, there is no need to merge.
+        if (*KnownClassEquality == true)
+          continue;
+        // We are about to add the newly simplified symbol to this equivalence
----------------
vsavchenko wrote:
> Now, since you put this logic into `merge`, you can just merge.
Wow, good catch.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D103314



More information about the cfe-commits mailing list