[PATCH] D99797: [analyzer] Implemented RangeSet::Factory::unite function to handle intersections and adjacency

Valeriy Savchenko via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed May 26 02:16:00 PDT 2021


vsavchenko added a comment.

To be honest, I don't think that it solves the problem I mentioned before.  The fact that conditions and branching are part of `operator++` now, doesn't cancel them.  I noticed that you made the first loop, so we don't need to check for `Min` in the main loop, and this is the right direction. But this approach has the same problem as one of the previous methods - you check `isFrom`, this is the price of abstraction. This is something that we won't be doing when working outside of such abstractions. Also, when one of the range sets is shorter, you will keep checking if the other iterator is end on every iteration when you run out of the ranges in shorter set.

I'm sorry for being so hard on you about this patch. 😔



================
Comment at: clang/lib/StaticAnalyzer/Core/RangeConstraintManager.cpp:257
+  // BoundCounter is 0 for outer `)`.
+  // BoundCounter is 1 for outer '(' or inner `)`.
+  // BoundCounter is 2 for inner `(`.
----------------
nit: it has different ticks than you use in all other places


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

https://reviews.llvm.org/D99797



More information about the cfe-commits mailing list