[PATCH] D57855: [analyzer] Reimplement checker options

Gábor Horváth via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Feb 11 03:16:22 PST 2019


xazax.hun added a comment.

We have `examples/analyzer-plugin`. I would prefer to add an example option to the example plugin so people do see how to do this when they are registering a checker from a plugin.



================
Comment at: include/clang/StaticAnalyzer/Checkers/Checkers.td:48
+    CmdLineOption<Boolean,
+                  "Optimistic",
+                  "In set to false, the checker assumes that it does not know "
----------------
Did you want to add this option to nullability? I believe it belongs to Malloc Checker.


================
Comment at: include/clang/StaticAnalyzer/Checkers/Checkers.td:49
+                  "Optimistic",
+                  "In set to false, the checker assumes that it does not know "
+                  "which functions might free the memory.",
----------------
`In` is a possible typo? `If` or `When`?


================
Comment at: include/clang/StaticAnalyzer/Checkers/Checkers.td:50
+                  "In set to false, the checker assumes that it does not know "
+                  "which functions might free the memory.",
+                  "false">,
----------------
Do we need `the`? Also, I think the checker also do not know the allocating functions. I think it might be better to describe the opposite. Optimistic means that the checker assumes all the allocating, deallocating functions are annotated.


================
Comment at: include/clang/StaticAnalyzer/Checkers/Checkers.td:384
+  CheckerOptions<[
+    CmdLineOption<Boolean,
+                  "Optimistic",
----------------
It would be great if there were a way to define options once and reuse them.


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

https://reviews.llvm.org/D57855





More information about the cfe-commits mailing list