clang-tools 20.0.0git
|
Preprocessor tracker for modularize. More...
#include <PreprocessorTracker.h>
Public Member Functions | |
virtual | ~PreprocessorTracker () |
virtual void | handlePreprocessorEntry (clang::Preprocessor &PP, llvm::StringRef RootHeaderFile)=0 |
virtual void | handlePreprocessorExit ()=0 |
virtual void | handleIncludeDirective (llvm::StringRef DirectivePath, int DirectiveLine, int DirectiveColumn, llvm::StringRef TargetPath)=0 |
virtual bool | checkForIncludesInBlock (clang::Preprocessor &PP, clang::SourceRange BlockSourceRange, const char *BlockIdentifierMessage, llvm::raw_ostream &OS)=0 |
virtual bool | reportInconsistentMacros (llvm::raw_ostream &OS)=0 |
virtual bool | reportInconsistentConditionals (llvm::raw_ostream &OS)=0 |
Static Public Member Functions | |
static PreprocessorTracker * | create (llvm::SmallVector< std::string, 32 > &Headers, bool DoBlockCheckHeaderListOnly) |
Preprocessor tracker for modularize.
The PreprocessorTracker class defines an API for checking macro expansions and preprocessor conditional expressions in a header file for consistency among one or more compilations of the header in a #include scenario. This is for helping a user find which macro expansions or conditionals might be problematic with respect to using the headers in the modules scenario, because they evaluate to different values depending on how or where a header is included.
The handlePreprocessorEntry function implementation will register a PPCallbacks object in the given Preprocessor object. The calls to the callbacks will collect information about the macro expansions and preprocessor conditionals encountered, for later analysis and reporting of inconsistencies between runs performed by calls to the reportInconsistentMacros and reportInconsistentConditionals functions respectively. The handlePreprocessorExit informs the implementation that a preprocessing session is complete, allowing it to do any needed compilation completion activities in the checker.
Definition at line 41 of file PreprocessorTracker.h.
|
virtual |
Definition at line 1260 of file PreprocessorTracker.cpp.
|
pure virtual |
|
static |
Definition at line 1263 of file PreprocessorTracker.cpp.
Referenced by main().
|
pure virtual |
|
pure virtual |
Referenced by CollectEntitiesConsumer::CollectEntitiesConsumer().
|
pure virtual |
Referenced by CollectEntitiesConsumer::~CollectEntitiesConsumer().
|
pure virtual |
|
pure virtual |