[PATCH] D69731: [analyzer] CheckerContext: Make the Preprocessor available

2020-01-30 Thread Csaba Dabis via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG38ab3b876baa: [analyzer] CheckerContext: Make the Preprocessor available (authored by Charusso). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D69731/new/ ht

[PATCH] D69731: [analyzer] CheckerContext: Make the Preprocessor available

2019-11-01 Thread Csaba Dabis via Phabricator via cfe-commits
Charusso added a comment. In D69731#1730956 , @Charusso wrote: > I am thinking of a callback which is something like: > > void checkBeginAnalysis(const Decl *D, BugReporter &BR) const; > > > so it would be easy and meaningful to have a place for the `Pre

[PATCH] D69731: [analyzer] CheckerContext: Make the Preprocessor available

2019-11-01 Thread Csaba Dabis via Phabricator via cfe-commits
Charusso updated this revision to Diff 227557. Charusso added a comment. - Use less `const`, it prevented the usage of non-const methods. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D69731/new/ https://reviews.llvm.org/D69731 Files: clang/include/clang/StaticAnalyzer/Core/BugReporte

[PATCH] D69731: [analyzer] CheckerContext: Make the Preprocessor available

2019-11-01 Thread Csaba Dabis via Phabricator via cfe-commits
Charusso added a comment. I am thinking of a callback which is something like: void checkBeginAnalysis(const Decl *D, BugReporter &BR) const; so it would be easy and meaningful to have a place for the `Preprocessor` logic. Do you think it would worth it? Repository: rC Clang CHANGES SINC

[PATCH] D69731: [analyzer] CheckerContext: Make the Preprocessor available

2019-11-01 Thread Csaba Dabis via Phabricator via cfe-commits
Charusso added a comment. In D69731#1730899 , @NoQ wrote: > Clang-Tidy's `PPCallbacks` subsystem looks much more realistic. I wanted to make it available from the `AnalysisManager` so that I can obtain the macro definitions once before the analysis star

[PATCH] D69731: [analyzer] CheckerContext: Make the Preprocessor available

2019-11-01 Thread Artem Dergachev via Phabricator via cfe-commits
NoQ added a comment. It sounds like the code is querying the temporary internal state of the preprocessor which is supposed to be queried during preprocessing, not after it. Say, `PP.isMacroDefined("__STDC_LIB_EXT1__")` clearly depends on the location, as a macro can be un-defined and re-define

[PATCH] D69731: [analyzer] CheckerContext: Make the Preprocessor available

2019-11-01 Thread Csaba Dabis via Phabricator via cfe-commits
Charusso added a comment. In D69731#1730784 , @NoQ wrote: > I'm not sure though - because we somehow survived without this for like 10 > years. Eg. `BugReporterVisitors.cpp`: [...] > I'd love to see some actual use before committing. "Teaser": const

[PATCH] D69731: [analyzer] CheckerContext: Make the Preprocessor available

2019-11-01 Thread Artem Dergachev via Phabricator via cfe-commits
NoQ accepted this revision. NoQ added a comment. This revision is now accepted and ready to land. We probably need this because every time we try to deal with macros we struggle quite a bit. I'm not sure though - because we somehow survived without this for like 10 years. Eg. `BugReporterVisito

[PATCH] D69731: [analyzer] CheckerContext: Make the Preprocessor available

2019-11-01 Thread Artem Dergachev via Phabricator via cfe-commits
NoQ added a comment. Also path-insensitive checkers will probably benefit a lot more from this info. Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D69731/new/ https://reviews.llvm.org/D69731 ___ cfe-commits mailing li

[PATCH] D69731: [analyzer] CheckerContext: Make the Preprocessor available

2019-11-01 Thread Csaba Dabis via Phabricator via cfe-commits
Charusso marked an inline comment as done. Charusso added a comment. It is needed for my work, and also I have seen other checkers in need of that. Comment at: clang/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp:195 ASTContext *Ctx; - const Preprocessor &PP; const std

[PATCH] D69731: [analyzer] CheckerContext: Make the Preprocessor available

2019-11-01 Thread Csaba Dabis via Phabricator via cfe-commits
Charusso created this revision. Charusso added a reviewer: NoQ. Charusso added a project: clang. Herald added subscribers: cfe-commits, dkrupp, donat.nagy, Szelethus, mikhail.ramalho, a.sidorin, szepet, baloghadamsoftware, xazax.hun. Charusso added a parent revision: D69726: [analyzer] DynamicSize