clang 22.0.0git
|
Simple wrapper class for chaining callbacks. More...
#include "clang/Lex/PPCallbacks.h"
Public Member Functions | |
PPChainedCallbacks (std::unique_ptr< PPCallbacks > _First, std::unique_ptr< PPCallbacks > _Second) | |
~PPChainedCallbacks () override | |
void | FileChanged (SourceLocation Loc, FileChangeReason Reason, SrcMgr::CharacteristicKind FileType, FileID PrevFID) override |
Callback invoked whenever a source file is entered or exited. | |
void | LexedFileChanged (FileID FID, LexedFileChangeReason Reason, SrcMgr::CharacteristicKind FileType, FileID PrevFID, SourceLocation Loc) override |
Callback invoked whenever the Lexer moves to a different file for lexing. | |
void | FileSkipped (const FileEntryRef &SkippedFile, const Token &FilenameTok, SrcMgr::CharacteristicKind FileType) override |
Callback invoked whenever a source file is skipped as the result of header guard optimization. | |
bool | EmbedFileNotFound (StringRef FileName) override |
Callback invoked whenever the preprocessor cannot find a file for an embed directive. | |
void | EmbedDirective (SourceLocation HashLoc, StringRef FileName, bool IsAngled, OptionalFileEntryRef File, const LexEmbedParametersResult &Params) override |
Callback invoked whenever an embed directive has been processed, regardless of whether the embed will actually find a file. | |
bool | FileNotFound (StringRef FileName) override |
Callback invoked whenever the preprocessor cannot find a file for an inclusion directive. | |
void | InclusionDirective (SourceLocation HashLoc, const Token &IncludeTok, StringRef FileName, bool IsAngled, CharSourceRange FilenameRange, OptionalFileEntryRef File, StringRef SearchPath, StringRef RelativePath, const Module *SuggestedModule, bool ModuleImported, SrcMgr::CharacteristicKind FileType) override |
Callback invoked whenever an inclusion directive of any kind (#include , #import , etc.) has been processed, regardless of whether the inclusion will actually result in an inclusion. | |
void | EnteredSubmodule (Module *M, SourceLocation ImportLoc, bool ForPragma) override |
Callback invoked whenever a submodule was entered. | |
void | LeftSubmodule (Module *M, SourceLocation ImportLoc, bool ForPragma) override |
Callback invoked whenever a submodule was left. | |
void | moduleImport (SourceLocation ImportLoc, ModuleIdPath Path, const Module *Imported) override |
Callback invoked whenever there was an explicit module-import syntax. | |
void | EndOfMainFile () override |
Callback invoked when the end of the main file is reached. | |
void | Ident (SourceLocation Loc, StringRef str) override |
Callback invoked when a #ident or #sccs directive is read. | |
void | PragmaDirective (SourceLocation Loc, PragmaIntroducerKind Introducer) override |
Callback invoked when start reading any pragma directive. | |
void | PragmaComment (SourceLocation Loc, const IdentifierInfo *Kind, StringRef Str) override |
Callback invoked when a #pragma comment directive is read. | |
void | PragmaMark (SourceLocation Loc, StringRef Trivia) override |
Callback invoked when a #pragma mark comment is read. | |
void | PragmaDetectMismatch (SourceLocation Loc, StringRef Name, StringRef Value) override |
Callback invoked when a #pragma detect_mismatch directive is read. | |
void | PragmaDebug (SourceLocation Loc, StringRef DebugType) override |
Callback invoked when a #pragma clang __debug directive is read. | |
void | PragmaMessage (SourceLocation Loc, StringRef Namespace, PragmaMessageKind Kind, StringRef Str) override |
Callback invoked when a #pragma message directive is read. | |
void | PragmaDiagnosticPush (SourceLocation Loc, StringRef Namespace) override |
Callback invoked when a #pragma gcc diagnostic push directive is read. | |
void | PragmaDiagnosticPop (SourceLocation Loc, StringRef Namespace) override |
Callback invoked when a #pragma gcc diagnostic pop directive is read. | |
void | PragmaDiagnostic (SourceLocation Loc, StringRef Namespace, diag::Severity mapping, StringRef Str) override |
Callback invoked when a #pragma gcc diagnostic directive is read. | |
void | HasEmbed (SourceLocation Loc, StringRef FileName, bool IsAngled, OptionalFileEntryRef File) override |
Hook called when a '__has_embed' directive is read. | |
void | HasInclude (SourceLocation Loc, StringRef FileName, bool IsAngled, OptionalFileEntryRef File, SrcMgr::CharacteristicKind FileType) override |
Hook called when a '__has_include' or '__has_include_next' directive is read. | |
void | PragmaOpenCLExtension (SourceLocation NameLoc, const IdentifierInfo *Name, SourceLocation StateLoc, unsigned State) override |
Called when an OpenCL extension is either disabled or enabled with a pragma. | |
void | PragmaWarning (SourceLocation Loc, PragmaWarningSpecifier WarningSpec, ArrayRef< int > Ids) override |
void | PragmaWarningPush (SourceLocation Loc, int Level) override |
Callback invoked when a #pragma warning(push) directive is read. | |
void | PragmaWarningPop (SourceLocation Loc) override |
Callback invoked when a #pragma warning(pop) directive is read. | |
void | PragmaExecCharsetPush (SourceLocation Loc, StringRef Str) override |
Callback invoked when a #pragma execution_character_set(push) directive is read. | |
void | PragmaExecCharsetPop (SourceLocation Loc) override |
Callback invoked when a #pragma execution_character_set(pop) directive is read. | |
void | PragmaAssumeNonNullBegin (SourceLocation Loc) override |
Callback invoked when a #pragma clang assume_nonnull begin directive is read. | |
void | PragmaAssumeNonNullEnd (SourceLocation Loc) override |
Callback invoked when a #pragma clang assume_nonnull end directive is read. | |
void | MacroExpands (const Token &MacroNameTok, const MacroDefinition &MD, SourceRange Range, const MacroArgs *Args) override |
Called by Preprocessor::HandleMacroExpandedIdentifier when a macro invocation is found. | |
void | MacroDefined (const Token &MacroNameTok, const MacroDirective *MD) override |
Hook called whenever a macro definition is seen. | |
void | MacroUndefined (const Token &MacroNameTok, const MacroDefinition &MD, const MacroDirective *Undef) override |
Hook called whenever a macro #undef is seen. | |
void | Defined (const Token &MacroNameTok, const MacroDefinition &MD, SourceRange Range) override |
Hook called whenever the 'defined' operator is seen. | |
void | SourceRangeSkipped (SourceRange Range, SourceLocation EndifLoc) override |
Hook called when a source range is skipped. | |
void | If (SourceLocation Loc, SourceRange ConditionRange, ConditionValueKind ConditionValue) override |
Hook called whenever an #if is seen. | |
void | Elif (SourceLocation Loc, SourceRange ConditionRange, ConditionValueKind ConditionValue, SourceLocation IfLoc) override |
Hook called whenever an #elif is seen. | |
void | Ifdef (SourceLocation Loc, const Token &MacroNameTok, const MacroDefinition &MD) override |
Hook called whenever an #ifdef is seen. | |
void | Elifdef (SourceLocation Loc, const Token &MacroNameTok, const MacroDefinition &MD) override |
Hook called whenever an #elifdef is taken. | |
void | Elifdef (SourceLocation Loc, SourceRange ConditionRange, SourceLocation IfLoc) override |
Hook called whenever an #elifdef is skipped. | |
void | Ifndef (SourceLocation Loc, const Token &MacroNameTok, const MacroDefinition &MD) override |
Hook called whenever an #ifndef is seen. | |
void | Elifndef (SourceLocation Loc, const Token &MacroNameTok, const MacroDefinition &MD) override |
Hook called whenever an #elifndef is taken. | |
void | Elifndef (SourceLocation Loc, SourceRange ConditionRange, SourceLocation IfLoc) override |
Hook called whenever an #elifndef is skipped. | |
void | Else (SourceLocation Loc, SourceLocation IfLoc) override |
Hook called whenever an #else is seen. | |
void | Endif (SourceLocation Loc, SourceLocation IfLoc) override |
Hook called whenever an #endif is seen. | |
Public Member Functions inherited from clang::PPCallbacks | |
virtual | ~PPCallbacks () |
Additional Inherited Members | |
Public Types inherited from clang::PPCallbacks | |
enum | FileChangeReason { EnterFile , ExitFile , SystemHeaderPragma , RenameFile } |
enum class | LexedFileChangeReason { EnterFile , ExitFile } |
enum | PragmaMessageKind { PMK_Message , PMK_Warning , PMK_Error } |
Determines the kind of #pragma invoking a call to PragmaMessage. More... | |
enum | PragmaWarningSpecifier { PWS_Default , PWS_Disable , PWS_Error , PWS_Once , PWS_Suppress , PWS_Level1 , PWS_Level2 , PWS_Level3 , PWS_Level4 } |
Callback invoked when a #pragma warning directive is read. More... | |
enum | ConditionValueKind { CVK_NotEvaluated , CVK_False , CVK_True } |
Simple wrapper class for chaining callbacks.
Definition at line 471 of file PPCallbacks.h.
|
inline |
Definition at line 475 of file PPCallbacks.h.
|
overridedefault |
|
inlineoverridevirtual |
Hook called whenever the 'defined' operator is seen.
MD | The MacroDirective if the name was a macro, null otherwise. |
Reimplemented from clang::PPCallbacks.
Definition at line 688 of file PPCallbacks.h.
|
inlineoverridevirtual |
Hook called whenever an #elif is seen.
Reimplemented from clang::PPCallbacks.
Definition at line 707 of file PPCallbacks.h.
|
inlineoverridevirtual |
Hook called whenever an #elifdef is taken.
Reimplemented from clang::PPCallbacks.
Definition at line 721 of file PPCallbacks.h.
|
inlineoverridevirtual |
Hook called whenever an #elifdef is skipped.
Reimplemented from clang::PPCallbacks.
Definition at line 727 of file PPCallbacks.h.
|
inlineoverridevirtual |
Hook called whenever an #elifndef is taken.
Reimplemented from clang::PPCallbacks.
Definition at line 741 of file PPCallbacks.h.
|
inlineoverridevirtual |
Hook called whenever an #elifndef is skipped.
Reimplemented from clang::PPCallbacks.
Definition at line 747 of file PPCallbacks.h.
|
inlineoverridevirtual |
Hook called whenever an #else is seen.
Reimplemented from clang::PPCallbacks.
Definition at line 754 of file PPCallbacks.h.
|
inlineoverridevirtual |
Callback invoked whenever an embed directive has been processed, regardless of whether the embed will actually find a file.
HashLoc | The location of the '#' that starts the embed directive. |
FileName | The name of the file being included, as written in the source code. |
IsAngled | Whether the file name was enclosed in angle brackets; otherwise, it was enclosed in quotes. |
File | The actual file that may be included by this embed directive. |
Params | The parameters used by the directive. |
Reimplemented from clang::PPCallbacks.
Definition at line 509 of file PPCallbacks.h.
References clang::File, and clang::FileName.
|
inlineoverridevirtual |
Callback invoked whenever the preprocessor cannot find a file for an embed directive.
FileName | The name of the file being included, as written in the source code. |
Reimplemented from clang::PPCallbacks.
Definition at line 501 of file PPCallbacks.h.
References clang::FileName, and clang::sema::Skip.
|
inlineoverridevirtual |
Hook called whenever an #endif is seen.
Reimplemented from clang::PPCallbacks.
Definition at line 760 of file PPCallbacks.h.
|
inlineoverridevirtual |
Callback invoked when the end of the main file is reached.
No subsequent callbacks will be made.
Reimplemented from clang::PPCallbacks.
Definition at line 557 of file PPCallbacks.h.
|
inlineoverridevirtual |
Callback invoked whenever a submodule was entered.
M | The submodule we have entered. |
ImportLoc | The location of import directive token. |
ForPragma | If entering from pragma directive. |
Reimplemented from clang::PPCallbacks.
Definition at line 539 of file PPCallbacks.h.
|
inlineoverridevirtual |
Callback invoked whenever a source file is entered or exited.
Loc | Indicates the new location. |
PrevFID | the file that was exited if Reason is ExitFile or the the file before the new one entered for Reason EnterFile. |
Reimplemented from clang::PPCallbacks.
Definition at line 481 of file PPCallbacks.h.
|
inlineoverridevirtual |
Callback invoked whenever the preprocessor cannot find a file for an inclusion directive.
FileName | The name of the file being included, as written in the source code. |
Reimplemented from clang::PPCallbacks.
Definition at line 516 of file PPCallbacks.h.
References clang::FileName, and clang::sema::Skip.
|
inlineoverridevirtual |
Callback invoked whenever a source file is skipped as the result of header guard optimization.
SkippedFile | The file that is skipped instead of entering #include |
FilenameTok | The file name token in #include "FileName" directive or macro expanded file name token from #include MACRO(PARAMS) directive. Note that FilenameTok contains corresponding quotes/angles symbols. |
Reimplemented from clang::PPCallbacks.
Definition at line 495 of file PPCallbacks.h.
|
inlineoverridevirtual |
Hook called when a '__has_embed' directive is read.
Reimplemented from clang::PPCallbacks.
Definition at line 617 of file PPCallbacks.h.
References clang::File, and clang::FileName.
|
overridevirtual |
Hook called when a '__has_include' or '__has_include_next' directive is read.
Reimplemented from clang::PPCallbacks.
Definition at line 23 of file PPCallbacks.cpp.
References clang::File, and clang::FileName.
|
inlineoverridevirtual |
Callback invoked when a #ident or #sccs directive is read.
Loc | The location of the directive. |
str | The text of the directive. |
Reimplemented from clang::PPCallbacks.
Definition at line 562 of file PPCallbacks.h.
|
inlineoverridevirtual |
Hook called whenever an #if is seen.
Reimplemented from clang::PPCallbacks.
Definition at line 700 of file PPCallbacks.h.
|
inlineoverridevirtual |
Hook called whenever an #ifdef is seen.
Reimplemented from clang::PPCallbacks.
Definition at line 714 of file PPCallbacks.h.
|
inlineoverridevirtual |
Hook called whenever an #ifndef is seen.
Reimplemented from clang::PPCallbacks.
Definition at line 734 of file PPCallbacks.h.
|
inlineoverridevirtual |
Callback invoked whenever an inclusion directive of any kind (#include
, #import
, etc.) has been processed, regardless of whether the inclusion will actually result in an inclusion.
HashLoc | The location of the '#' that starts the inclusion directive. |
IncludeTok | The token that indicates the kind of inclusion directive, e.g., 'include' or 'import'. |
FileName | The name of the file being included, as written in the source code. |
IsAngled | Whether the file name was enclosed in angle brackets; otherwise, it was enclosed in quotes. |
FilenameRange | The character range of the quotes or angle brackets for the written file name. |
File | The actual file that may be included by this inclusion directive. |
SearchPath | Contains the search path which was used to find the file in the file system. If the file was found via an absolute include path, SearchPath will be empty. For framework includes, the SearchPath and RelativePath will be split up. For example, if an include of "Some/Some.h" is found via the framework path "path/to/Frameworks/Some.framework/Headers/Some.h", SearchPath will be "path/to/Frameworks/Some.framework/Headers" and RelativePath will be "Some.h". |
RelativePath | The path relative to SearchPath, at which the include file was found. This is equal to FileName except for framework includes. |
SuggestedModule | The module suggested for this header, if any. |
ModuleImported | Whether this include was translated into import of SuggestedModule . |
FileType | The characteristic kind, indicates whether a file or directory holds normal user code, system code, or system code which is implicitly 'extern "C"' in C++ mode. |
Reimplemented from clang::PPCallbacks.
Definition at line 524 of file PPCallbacks.h.
References clang::File, and clang::FileName.
|
inlineoverridevirtual |
Callback invoked whenever a submodule was left.
M | The submodule we have left. |
ImportLoc | The location of import directive token. |
ForPragma | If entering from pragma directive. |
Reimplemented from clang::PPCallbacks.
Definition at line 545 of file PPCallbacks.h.
|
inlineoverridevirtual |
Callback invoked whenever the Lexer
moves to a different file for lexing.
Unlike FileChanged
line number directives and other related pragmas do not trigger callbacks to LexedFileChanged
.
FID | The FileID that the Lexer moved to. |
Reason | Whether the Lexer entered a new file or exited one. |
FileType | The CharacteristicKind of the file the Lexer moved to. |
PrevFID | The FileID the Lexer was using before the change. |
Loc | The location where the Lexer entered a new file from or the location that the Lexer moved into after exiting a file. |
Reimplemented from clang::PPCallbacks.
Definition at line 488 of file PPCallbacks.h.
|
inlineoverridevirtual |
Hook called whenever a macro definition is seen.
Reimplemented from clang::PPCallbacks.
Definition at line 675 of file PPCallbacks.h.
|
inlineoverridevirtual |
Called by Preprocessor::HandleMacroExpandedIdentifier when a macro invocation is found.
Reimplemented from clang::PPCallbacks.
Definition at line 669 of file PPCallbacks.h.
|
inlineoverridevirtual |
Hook called whenever a macro #undef is seen.
MacroNameTok | The active Token |
MD | A MacroDefinition for the named macro. |
Undef | New MacroDirective if the macro was defined, null otherwise. |
MD is released immediately following this callback.
Reimplemented from clang::PPCallbacks.
Definition at line 681 of file PPCallbacks.h.
|
inlineoverridevirtual |
Callback invoked whenever there was an explicit module-import syntax.
ImportLoc | The location of import directive token. |
Path | The identifiers (and their locations) of the module "path", e.g., "std.vector" would be split into "std" and "vector". |
Imported | The imported module; can be null if importing failed. |
Reimplemented from clang::PPCallbacks.
Definition at line 551 of file PPCallbacks.h.
|
inlineoverridevirtual |
Callback invoked when a #pragma clang assume_nonnull begin directive is read.
Reimplemented from clang::PPCallbacks.
Definition at line 659 of file PPCallbacks.h.
|
inlineoverridevirtual |
Callback invoked when a #pragma clang assume_nonnull end directive is read.
Reimplemented from clang::PPCallbacks.
Definition at line 664 of file PPCallbacks.h.
|
inlineoverridevirtual |
Callback invoked when a #pragma comment directive is read.
Reimplemented from clang::PPCallbacks.
Definition at line 573 of file PPCallbacks.h.
|
inlineoverridevirtual |
Callback invoked when a #pragma clang __debug directive is read.
Loc | The location of the debug directive. |
DebugType | The identifier following __debug. |
Reimplemented from clang::PPCallbacks.
Definition at line 590 of file PPCallbacks.h.
|
inlineoverridevirtual |
Callback invoked when a #pragma detect_mismatch directive is read.
Reimplemented from clang::PPCallbacks.
Definition at line 584 of file PPCallbacks.h.
|
inlineoverridevirtual |
Callback invoked when a #pragma gcc diagnostic directive is read.
Reimplemented from clang::PPCallbacks.
Definition at line 611 of file PPCallbacks.h.
|
inlineoverridevirtual |
Callback invoked when a #pragma gcc diagnostic pop directive is read.
Reimplemented from clang::PPCallbacks.
Definition at line 606 of file PPCallbacks.h.
|
inlineoverridevirtual |
Callback invoked when a #pragma gcc diagnostic push directive is read.
Reimplemented from clang::PPCallbacks.
Definition at line 601 of file PPCallbacks.h.
|
inlineoverridevirtual |
Callback invoked when start reading any pragma directive.
Reimplemented from clang::PPCallbacks.
Definition at line 567 of file PPCallbacks.h.
|
inlineoverridevirtual |
Callback invoked when a #pragma execution_character_set(pop) directive is read.
Reimplemented from clang::PPCallbacks.
Definition at line 654 of file PPCallbacks.h.
|
inlineoverridevirtual |
Callback invoked when a #pragma execution_character_set(push) directive is read.
Reimplemented from clang::PPCallbacks.
Definition at line 649 of file PPCallbacks.h.
|
inlineoverridevirtual |
Callback invoked when a #pragma mark comment is read.
Reimplemented from clang::PPCallbacks.
Definition at line 579 of file PPCallbacks.h.
|
inlineoverridevirtual |
Callback invoked when a #pragma message directive is read.
Loc | The location of the message directive. |
Namespace | The namespace of the message directive. |
Kind | The type of the message directive. |
Str | The text of the message directive. |
Reimplemented from clang::PPCallbacks.
Definition at line 595 of file PPCallbacks.h.
|
inlineoverridevirtual |
Called when an OpenCL extension is either disabled or enabled with a pragma.
Reimplemented from clang::PPCallbacks.
Definition at line 627 of file PPCallbacks.h.
|
inlineoverridevirtual |
Reimplemented from clang::PPCallbacks.
Definition at line 633 of file PPCallbacks.h.
|
inlineoverridevirtual |
Callback invoked when a #pragma warning(pop) directive is read.
Reimplemented from clang::PPCallbacks.
Definition at line 644 of file PPCallbacks.h.
|
inlineoverridevirtual |
Callback invoked when a #pragma warning(push) directive is read.
Reimplemented from clang::PPCallbacks.
Definition at line 639 of file PPCallbacks.h.
|
inlineoverridevirtual |
Hook called when a source range is skipped.
Range | The SourceRange that was skipped. The range begins at the #if/#else directive and ends after the #endif/#else directive. |
EndifLoc | The end location of the 'endif' token, which may precede the range skipped by the directive (e.g excluding comments after an 'endif'). |
Reimplemented from clang::PPCallbacks.
Definition at line 694 of file PPCallbacks.h.