[PATCH] D126406: [analyzer] Return from reAssume if State is posteriorly overconstrained

Balázs Benics via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed May 25 14:02:54 PDT 2022


steakhal added a comment.

Thanks for the quick response!



================
Comment at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/ProgramState.h:127
+
+public:
   bool isPosteriorlyOverconstrained() const {
----------------
This shouldnt be the way.
Consider fwd declaring and making it friend instead.
I really dont want to expose this api.


================
Comment at: clang/lib/StaticAnalyzer/Core/RangeConstraintManager.cpp:2547
   if (Constraint->encodesFalseRange())
     return State->assume(DefinedVal, false);
 
----------------
martong wrote:
> I am wondering, that maybe it would be better to check for `isPosteriorlyOverconstrained` here. Because only `State->assume` can return such States, and by checking it here, we could spare some instructions.
Play with it.


================
Comment at: clang/test/Analysis/runtime-regression.c:7
+// This test is here to check if there is no significant run-time regression
+// related to the assume machinery. This is an automatically reduced code. The
+// analysis should finish in less than 10 seconds.
----------------
Sadly, I had to manually track this down xD.


================
Comment at: clang/test/Analysis/runtime-regression.c:8
+// related to the assume machinery. This is an automatically reduced code. The
+// analysis should finish in less than 10 seconds.
+
----------------
Maybe the test infra has something to specify a timeout.


================
Comment at: clang/test/Analysis/runtime-regression.c:12
+
+typedef unsigned char uint8_t;
+typedef unsigned short uint16_t;
----------------
Pin the tartget triple.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D126406



More information about the cfe-commits mailing list