[PATCH] D77150: [Analyzer] New Option for ContainerModeling: AggressiveEraseModeling

Kristóf Umann via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Apr 2 04:51:25 PDT 2020


Szelethus added a comment.

Some tests would be appreciated, It really helps me understand whats going on.



================
Comment at: clang/include/clang/StaticAnalyzer/Checkers/Checkers.td:620-624
+                  "AggressiveEraseModeling",
+                  "Enables exploration of the past-the-end branch for the "
+                  "return value of the erase() method of containers.",
+                  "false",
+                  Released>
----------------
Hmm. The description isn't really user-friendly, imo, but the option doesn't sound too user-facing either. I don't think this is an option to be tinkered with. I think we should make this hidden.

Also, even for developers, I find this a bitconfusing at first. Do we not enable that by default? Why not? What do we have to gain/lose?


================
Comment at: clang/lib/StaticAnalyzer/Checkers/ContainerModeling.cpp:692-699
+          std::tie(StateEnd, StateNotEnd) = State->assume(*RetEnd);
+          if (StateEnd) {
+            C.addTransition(StateEnd);
+          }
+          if (StateNotEnd) {
+            C.addTransition(StateNotEnd);
+          }
----------------
Right, so the const is a state split. That doesn't sound like something regular users should fine-tune.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D77150





More information about the cfe-commits mailing list