[PATCH] [Analyzer] Individual options for checkers #2

Gábor Horváth xazax.hun at gmail.com
Fri Feb 27 03:15:46 PST 2015


I agree that the Optimistic option for the malloc checker should not be inherited.

About the testing: 
I think the most appropriate way to test this feature would be to write some unit tests for AnalyzerOptions class. However there are no unittests for the static analyzer yet. Should I create some as part of this patch?

About the validation:
Right now there is no way for a checker to specify the package or checker name when querying an option. The getCheckerOption function is private (the config table is public tough). The checkers can use getBooleanOption with a pointer to the checker, this means filling the package name and checker name is automatic. With this API a checker can not query the options of an unrelated package and there is no way to misspell the package or the checker name. Right now there is no validation for the option name. Should global option names for the static analyzer be validated as well?


================
Comment at: include/clang/StaticAnalyzer/Core/AnalyzerOptions.h:191
@@ -179,1 +190,3 @@
+  };
+
 private:
----------------
zaks.anna wrote:
> We were trying to stay away from inheritance of options not to imply that the checkers will automatically inherit options. See the discussion on the proposal thread:
> http://lists.cs.uiuc.edu/pipermail/cfe-dev/2014-October/039576.html
I think the inheritance is explicit in this case, the checker have to specify it when querying the option. Should I change something here (e.g. remove the inherited versions or modify their semantics) or you only intended to link the discussion for other reviewers?

================
Comment at: include/clang/StaticAnalyzer/Core/AnalyzerOptions.h:291
@@ +290,3 @@
+                             StringRef Default,
+                             OptionKind Kind = OptionKind::Global);
+
----------------
zaks.anna wrote:
> I'd simplify this and have it take a book instead of the Kind.
Could you elaborate on that?

http://reviews.llvm.org/D7905

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the cfe-commits mailing list