-
Notifications
You must be signed in to change notification settings - Fork 356
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[analyze] Add option to control Clang SA header analysis and macro expansion #4003
base: master
Are you sure you want to change the base?
[analyze] Add option to control Clang SA header analysis and macro expansion #4003
Conversation
… expansion Added two options '--analyze-headers [on|off] default=on' to enable/disable clang SA analysis of headers '--expand-macros [on|off] default=on' to enable/disable macro expansion in generated plist
I'm proposing this change to reduce analysis time for precommit approval. The project I'd like to apply it to consists of approx 1600 source files and takes 5 1/2 hours to analyze with expand-macros=true and -analyzer-opt-analyze-headers enabled. Not setting those options reduces analysis time to ~30 minutes, which is acceptable for a precommit check |
Hi! Sorry for the late response, we definitely appreciate all the help we can get! We already have an option to pass clang static analyzer flags through CodeChecker via the The problem I foresee is that CodeChecker is (increasingly) less of wrapper around Clang, and more of a general static analysis driver tool, so creating analyzer specific flags may go contradictory to that. This doesn't mean we make exceptions (just look at all the CTU options that, as of now, specifically target ClangSA), I'm just not immediately sure we want to make one here. Cheers, |
The problem is that codechecker sets -analyzer-opt-analyze-headers and there is no option to clang to turn it off once its passed on the cli. And because it already passes expand-macros=true a subsequent expand-macros=false fails as well with |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi,
Thanks for the improvement. However, we wouldn't like to go in the direction of extending the interface of CodeChecker analyze. The analyzer configuration options shouldn't be exposed on this interface, because there will always be yet another analyzer option that somebody wants to introduce for CodeChecker analyze. I think these analyzer config options should be provided through --analyzer-config
flag.
How about just removing '-analyzer-opt-analyze-headers' and 'expand-macros=true' and require people who want it to add those options via --saargs |
Hi, |
Added two options
--analyze-headers [on|off]
(default on) to enable/disable clang SA analysis of headers--expand-macros [on|off]
(default on) to enable/disable macro expansion in generated plist