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

Gabor Marton via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu May 26 02:49:28 PDT 2022


martong added inline comments.


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


================
Comment at: clang/lib/StaticAnalyzer/Core/RangeConstraintManager.cpp:2547
   if (Constraint->encodesFalseRange())
     return State->assume(DefinedVal, false);
 
----------------
steakhal wrote:
> 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.
Yeah, I will, but I don't know how much time that would take to assess. So, in the meantime let's proceed with this version.


================
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.
----------------
steakhal wrote:
> Sadly, I had to manually track this down xD.
Ok, I removed the sentence.


================
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.
+
----------------
steakhal wrote:
> Maybe the test infra has something to specify a timeout.
I could not find how to set a timeout in the test file. There is a lit cli option that might be used, however, that would affect all other test cases. https://llvm.org/docs/CommandGuide/lit.html#cmdoption-lit-timeout


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


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