[PATCH] D86465: [analyzer][solver] Redesign constraint ranges data structure

Valeriy Savchenko via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Aug 25 01:10:29 PDT 2020


vsavchenko added inline comments.


================
Comment at: clang/lib/StaticAnalyzer/Core/RangeConstraintManager.cpp:119
+
+  return makePersistent(std::move(Result));
+}
----------------
NoQ wrote:
> Given that we're certain from the start that the container will be persistent, can we save a copy by directly asking the factory to allocate a fresh container?
> 
> Also this seems to be one of the cases where variable-sized small vectors would make sense.
Surprisingly this is not the case, it is cheaper to do whatever you want on small vectors on the stack and check if we already allocated it.
So, it is a deliberate choice to do it this way (you can see it in the comment inside of the `makePersistent` function.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D86465



More information about the cfe-commits mailing list