clang-tools 3.8.0

- Main Page
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions | Static Public Member Functions | List of all members
Modularize::PreprocessorTracker Class Referenceabstract

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)

## Detailed Description

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 42 of file PreprocessorTracker.h.

## Constructor & Destructor Documentation

Modularize::PreprocessorTracker::~PreprocessorTracker | ( |  | ) |
| virtual

Definition at line 1291 of file PreprocessorTracker.cpp.

## Member Function Documentation

virtual bool Modularize::PreprocessorTracker::checkForIncludesInBlock | ( | clang::Preprocessor & | PP,
|  | clang::SourceRange | BlockSourceRange,
|  | const char * | BlockIdentifierMessage,
|  | llvm::raw_ostream & | OS
| ) |  |
| pure virtual

PreprocessorTracker * Modularize::PreprocessorTracker::create | ( | llvm::SmallVector< std::string, 32 > & | Headers,
|  | bool | DoBlockCheckHeaderListOnly
| ) |  |
| static

Definition at line 1294 of file PreprocessorTracker.cpp.

virtual void Modularize::PreprocessorTracker::handleIncludeDirective | ( | llvm::StringRef | DirectivePath,
|  | int | DirectiveLine,
|  | int | DirectiveColumn,
|  | llvm::StringRef | TargetPath
| ) |  |
| pure virtual

virtual void Modularize::PreprocessorTracker::handlePreprocessorEntry | ( | clang::Preprocessor & | PP,
|  | llvm::StringRef | RootHeaderFile
| ) |  |
| pure virtual

virtual void Modularize::PreprocessorTracker::handlePreprocessorExit | ( |  | ) |
| pure virtual

virtual bool Modularize::PreprocessorTracker::reportInconsistentConditionals | ( | llvm::raw_ostream & | OS | ) |
| pure virtual

virtual bool Modularize::PreprocessorTracker::reportInconsistentMacros | ( | llvm::raw_ostream & | OS | ) |
| pure virtual

The documentation for this class was generated from the following files:

- PreprocessorTracker.h
- PreprocessorTracker.cpp