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

Csaba Dabis via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Nov 1 15:21:17 PDT 2019


Charusso added a comment.

In D69731#1730899 <https://reviews.llvm.org/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 starts. Nor the Clang Tidy's `PPCallback`, nor the `AnalysisManager` could retrieve the necessary information at that point in the analysis. However, at that point when we analyze something all the necessary information is available. Most of the Tidy checkers grab their own `PP` reference to use it later on. The Tidy devs agree to retrieve such information even in the main `check()` call which going to rerun in every `TranslationUnit`. So even it is so primitive, there is no better solution as I know. I hope we could find something better / cache it. At the moment this code-snippet I have just showed you runs in every `evalCall()`.


Repository:
  rC Clang

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

https://reviews.llvm.org/D69731





More information about the cfe-commits mailing list