clang 20.0.0git
Public Member Functions | List of all members
clang::PPChainedCallbacks Class Reference

Simple wrapper class for chaining callbacks. More...

#include "clang/Lex/PPCallbacks.h"

Inheritance diagram for clang::PPChainedCallbacks:
Inheritance graph
[legend]

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 ()
 
virtual void FileChanged (SourceLocation Loc, FileChangeReason Reason, SrcMgr::CharacteristicKind FileType, FileID PrevFID=FileID())
 Callback invoked whenever a source file is entered or exited.
 
virtual void LexedFileChanged (FileID FID, LexedFileChangeReason Reason, SrcMgr::CharacteristicKind FileType, FileID PrevFID, SourceLocation Loc)
 Callback invoked whenever the Lexer moves to a different file for lexing.
 
virtual void FileSkipped (const FileEntryRef &SkippedFile, const Token &FilenameTok, SrcMgr::CharacteristicKind FileType)
 Callback invoked whenever a source file is skipped as the result of header guard optimization.
 
virtual bool EmbedFileNotFound (StringRef FileName)
 Callback invoked whenever the preprocessor cannot find a file for an embed directive.
 
virtual void EmbedDirective (SourceLocation HashLoc, StringRef FileName, bool IsAngled, OptionalFileEntryRef File, const LexEmbedParametersResult &Params)
 Callback invoked whenever an embed directive has been processed, regardless of whether the embed will actually find a file.
 
virtual bool FileNotFound (StringRef FileName)
 Callback invoked whenever the preprocessor cannot find a file for an inclusion directive.
 
virtual 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)
 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.
 
virtual void EnteredSubmodule (Module *M, SourceLocation ImportLoc, bool ForPragma)
 Callback invoked whenever a submodule was entered.
 
virtual void LeftSubmodule (Module *M, SourceLocation ImportLoc, bool ForPragma)
 Callback invoked whenever a submodule was left.
 
virtual void moduleImport (SourceLocation ImportLoc, ModuleIdPath Path, const Module *Imported)
 Callback invoked whenever there was an explicit module-import syntax.
 
virtual void EndOfMainFile ()
 Callback invoked when the end of the main file is reached.
 
virtual void Ident (SourceLocation Loc, StringRef str)
 Callback invoked when a #ident or #sccs directive is read.
 
virtual void PragmaDirective (SourceLocation Loc, PragmaIntroducerKind Introducer)
 Callback invoked when start reading any pragma directive.
 
virtual void PragmaComment (SourceLocation Loc, const IdentifierInfo *Kind, StringRef Str)
 Callback invoked when a #pragma comment directive is read.
 
virtual void PragmaMark (SourceLocation Loc, StringRef Trivia)
 Callback invoked when a #pragma mark comment is read.
 
virtual void PragmaDetectMismatch (SourceLocation Loc, StringRef Name, StringRef Value)
 Callback invoked when a #pragma detect_mismatch directive is read.
 
virtual void PragmaDebug (SourceLocation Loc, StringRef DebugType)
 Callback invoked when a #pragma clang __debug directive is read.
 
virtual void PragmaMessage (SourceLocation Loc, StringRef Namespace, PragmaMessageKind Kind, StringRef Str)
 Callback invoked when a #pragma message directive is read.
 
virtual void PragmaDiagnosticPush (SourceLocation Loc, StringRef Namespace)
 Callback invoked when a #pragma gcc diagnostic push directive is read.
 
virtual void PragmaDiagnosticPop (SourceLocation Loc, StringRef Namespace)
 Callback invoked when a #pragma gcc diagnostic pop directive is read.
 
virtual void PragmaDiagnostic (SourceLocation Loc, StringRef Namespace, diag::Severity mapping, StringRef Str)
 Callback invoked when a #pragma gcc diagnostic directive is read.
 
virtual void PragmaOpenCLExtension (SourceLocation NameLoc, const IdentifierInfo *Name, SourceLocation StateLoc, unsigned State)
 Called when an OpenCL extension is either disabled or enabled with a pragma.
 
virtual void PragmaWarning (SourceLocation Loc, PragmaWarningSpecifier WarningSpec, ArrayRef< int > Ids)
 
virtual void PragmaWarningPush (SourceLocation Loc, int Level)
 Callback invoked when a #pragma warning(push) directive is read.
 
virtual void PragmaWarningPop (SourceLocation Loc)
 Callback invoked when a #pragma warning(pop) directive is read.
 
virtual void PragmaExecCharsetPush (SourceLocation Loc, StringRef Str)
 Callback invoked when a #pragma execution_character_set(push) directive is read.
 
virtual void PragmaExecCharsetPop (SourceLocation Loc)
 Callback invoked when a #pragma execution_character_set(pop) directive is read.
 
virtual void PragmaAssumeNonNullBegin (SourceLocation Loc)
 Callback invoked when a #pragma clang assume_nonnull begin directive is read.
 
virtual void PragmaAssumeNonNullEnd (SourceLocation Loc)
 Callback invoked when a #pragma clang assume_nonnull end directive is read.
 
virtual void MacroExpands (const Token &MacroNameTok, const MacroDefinition &MD, SourceRange Range, const MacroArgs *Args)
 Called by Preprocessor::HandleMacroExpandedIdentifier when a macro invocation is found.
 
virtual void MacroDefined (const Token &MacroNameTok, const MacroDirective *MD)
 Hook called whenever a macro definition is seen.
 
virtual void MacroUndefined (const Token &MacroNameTok, const MacroDefinition &MD, const MacroDirective *Undef)
 Hook called whenever a macro #undef is seen.
 
virtual void Defined (const Token &MacroNameTok, const MacroDefinition &MD, SourceRange Range)
 Hook called whenever the 'defined' operator is seen.
 
virtual void HasEmbed (SourceLocation Loc, StringRef FileName, bool IsAngled, OptionalFileEntryRef File)
 Hook called when a '__has_embed' directive is read.
 
virtual void HasInclude (SourceLocation Loc, StringRef FileName, bool IsAngled, OptionalFileEntryRef File, SrcMgr::CharacteristicKind FileType)
 Hook called when a '__has_include' or '__has_include_next' directive is read.
 
virtual void SourceRangeSkipped (SourceRange Range, SourceLocation EndifLoc)
 Hook called when a source range is skipped.
 
virtual void If (SourceLocation Loc, SourceRange ConditionRange, ConditionValueKind ConditionValue)
 Hook called whenever an #if is seen.
 
virtual void Elif (SourceLocation Loc, SourceRange ConditionRange, ConditionValueKind ConditionValue, SourceLocation IfLoc)
 Hook called whenever an #elif is seen.
 
virtual void Ifdef (SourceLocation Loc, const Token &MacroNameTok, const MacroDefinition &MD)
 Hook called whenever an #ifdef is seen.
 
virtual void Elifdef (SourceLocation Loc, const Token &MacroNameTok, const MacroDefinition &MD)
 Hook called whenever an #elifdef branch is taken.
 
virtual void Elifdef (SourceLocation Loc, SourceRange ConditionRange, SourceLocation IfLoc)
 Hook called whenever an #elifdef is skipped.
 
virtual void Ifndef (SourceLocation Loc, const Token &MacroNameTok, const MacroDefinition &MD)
 Hook called whenever an #ifndef is seen.
 
virtual void Elifndef (SourceLocation Loc, const Token &MacroNameTok, const MacroDefinition &MD)
 Hook called whenever an #elifndef branch is taken.
 
virtual void Elifndef (SourceLocation Loc, SourceRange ConditionRange, SourceLocation IfLoc)
 Hook called whenever an #elifndef is skipped.
 
virtual void Else (SourceLocation Loc, SourceLocation IfLoc)
 Hook called whenever an #else is seen.
 
virtual void Endif (SourceLocation Loc, SourceLocation IfLoc)
 Hook called whenever an #endif is seen.
 

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 }
 

Detailed Description

Simple wrapper class for chaining callbacks.

Definition at line 470 of file PPCallbacks.h.

Constructor & Destructor Documentation

◆ PPChainedCallbacks()

clang::PPChainedCallbacks::PPChainedCallbacks ( std::unique_ptr< PPCallbacks _First,
std::unique_ptr< PPCallbacks _Second 
)
inline

Definition at line 474 of file PPCallbacks.h.

References clang::First.

◆ ~PPChainedCallbacks()

PPChainedCallbacks::~PPChainedCallbacks ( )
overridedefault

Member Function Documentation

◆ Defined()

void clang::PPChainedCallbacks::Defined ( const Token MacroNameTok,
const MacroDefinition MD,
SourceRange  Range 
)
inlineoverridevirtual

Hook called whenever the 'defined' operator is seen.

Parameters
MDThe MacroDirective if the name was a macro, null otherwise.

Reimplemented from clang::PPCallbacks.

Definition at line 687 of file PPCallbacks.h.

References clang::First, and Range.

◆ Elif()

void clang::PPChainedCallbacks::Elif ( SourceLocation  Loc,
SourceRange  ConditionRange,
ConditionValueKind  ConditionValue,
SourceLocation  IfLoc 
)
inlineoverridevirtual

Hook called whenever an #elif is seen.

Reimplemented from clang::PPCallbacks.

Definition at line 706 of file PPCallbacks.h.

References clang::First, and Loc.

◆ Elifdef() [1/2]

void clang::PPChainedCallbacks::Elifdef ( SourceLocation  Loc,
const Token MacroNameTok,
const MacroDefinition MD 
)
inlineoverridevirtual

Hook called whenever an #elifdef is taken.

Reimplemented from clang::PPCallbacks.

Definition at line 720 of file PPCallbacks.h.

References clang::First, and Loc.

◆ Elifdef() [2/2]

void clang::PPChainedCallbacks::Elifdef ( SourceLocation  Loc,
SourceRange  ConditionRange,
SourceLocation  IfLoc 
)
inlineoverridevirtual

Hook called whenever an #elifdef is skipped.

Reimplemented from clang::PPCallbacks.

Definition at line 726 of file PPCallbacks.h.

References clang::First, and Loc.

◆ Elifndef() [1/2]

void clang::PPChainedCallbacks::Elifndef ( SourceLocation  Loc,
const Token MacroNameTok,
const MacroDefinition MD 
)
inlineoverridevirtual

Hook called whenever an #elifndef is taken.

Reimplemented from clang::PPCallbacks.

Definition at line 740 of file PPCallbacks.h.

References clang::First, and Loc.

◆ Elifndef() [2/2]

void clang::PPChainedCallbacks::Elifndef ( SourceLocation  Loc,
SourceRange  ConditionRange,
SourceLocation  IfLoc 
)
inlineoverridevirtual

Hook called whenever an #elifndef is skipped.

Reimplemented from clang::PPCallbacks.

Definition at line 746 of file PPCallbacks.h.

References clang::First, and Loc.

◆ Else()

void clang::PPChainedCallbacks::Else ( SourceLocation  Loc,
SourceLocation  IfLoc 
)
inlineoverridevirtual

Hook called whenever an #else is seen.

Reimplemented from clang::PPCallbacks.

Definition at line 753 of file PPCallbacks.h.

References clang::First, and Loc.

◆ EmbedDirective()

void clang::PPChainedCallbacks::EmbedDirective ( SourceLocation  HashLoc,
StringRef  FileName,
bool  IsAngled,
OptionalFileEntryRef  File,
const LexEmbedParametersResult Params 
)
inlineoverridevirtual

Callback invoked whenever an embed directive has been processed, regardless of whether the embed will actually find a file.

Parameters
HashLocThe location of the '#' that starts the embed directive.
FileNameThe name of the file being included, as written in the source code.
IsAngledWhether the file name was enclosed in angle brackets; otherwise, it was enclosed in quotes.
FileThe actual file that may be included by this embed directive.
ParamsThe parameters used by the directive.

Reimplemented from clang::PPCallbacks.

Definition at line 508 of file PPCallbacks.h.

References clang::File, clang::FileName, and clang::First.

◆ EmbedFileNotFound()

bool clang::PPChainedCallbacks::EmbedFileNotFound ( StringRef  FileName)
inlineoverridevirtual

Callback invoked whenever the preprocessor cannot find a file for an embed directive.

Parameters
FileNameThe name of the file being included, as written in the source code.
Returns
true to indicate that the preprocessor should skip this file and not issue any diagnostic.

Reimplemented from clang::PPCallbacks.

Definition at line 500 of file PPCallbacks.h.

References clang::FileName, clang::First, and clang::sema::Skip.

◆ Endif()

void clang::PPChainedCallbacks::Endif ( SourceLocation  Loc,
SourceLocation  IfLoc 
)
inlineoverridevirtual

Hook called whenever an #endif is seen.

Reimplemented from clang::PPCallbacks.

Definition at line 759 of file PPCallbacks.h.

References clang::First, and Loc.

◆ EndOfMainFile()

void clang::PPChainedCallbacks::EndOfMainFile ( )
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 556 of file PPCallbacks.h.

References clang::First.

◆ EnteredSubmodule()

void clang::PPChainedCallbacks::EnteredSubmodule ( Module M,
SourceLocation  ImportLoc,
bool  ForPragma 
)
inlineoverridevirtual

Callback invoked whenever a submodule was entered.

Parameters
MThe submodule we have entered.
ImportLocThe location of import directive token.
ForPragmaIf entering from pragma directive.

Reimplemented from clang::PPCallbacks.

Definition at line 538 of file PPCallbacks.h.

References clang::First.

◆ FileChanged()

void clang::PPChainedCallbacks::FileChanged ( SourceLocation  Loc,
FileChangeReason  Reason,
SrcMgr::CharacteristicKind  FileType,
FileID  PrevFID 
)
inlineoverridevirtual

Callback invoked whenever a source file is entered or exited.

Parameters
LocIndicates the new location.
PrevFIDthe 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 480 of file PPCallbacks.h.

References clang::First, and Loc.

◆ FileNotFound()

bool clang::PPChainedCallbacks::FileNotFound ( StringRef  FileName)
inlineoverridevirtual

Callback invoked whenever the preprocessor cannot find a file for an inclusion directive.

Parameters
FileNameThe name of the file being included, as written in the source code.
Returns
true to indicate that the preprocessor should skip this file and not issue any diagnostic.

Reimplemented from clang::PPCallbacks.

Definition at line 515 of file PPCallbacks.h.

References clang::FileName, clang::First, and clang::sema::Skip.

◆ FileSkipped()

void clang::PPChainedCallbacks::FileSkipped ( const FileEntryRef SkippedFile,
const Token FilenameTok,
SrcMgr::CharacteristicKind  FileType 
)
inlineoverridevirtual

Callback invoked whenever a source file is skipped as the result of header guard optimization.

Parameters
SkippedFileThe file that is skipped instead of entering #include
FilenameTokThe 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 494 of file PPCallbacks.h.

References clang::First.

◆ HasEmbed()

void clang::PPChainedCallbacks::HasEmbed ( SourceLocation  Loc,
StringRef  FileName,
bool  IsAngled,
OptionalFileEntryRef  File 
)
inlineoverridevirtual

Hook called when a '__has_embed' directive is read.

Reimplemented from clang::PPCallbacks.

Definition at line 616 of file PPCallbacks.h.

References clang::File, clang::FileName, clang::First, and Loc.

◆ HasInclude()

void PPChainedCallbacks::HasInclude ( SourceLocation  Loc,
StringRef  FileName,
bool  IsAngled,
OptionalFileEntryRef  File,
SrcMgr::CharacteristicKind  FileType 
)
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, clang::FileName, and Loc.

◆ Ident()

void clang::PPChainedCallbacks::Ident ( SourceLocation  Loc,
StringRef  str 
)
inlineoverridevirtual

Callback invoked when a #ident or #sccs directive is read.

Parameters
LocThe location of the directive.
strThe text of the directive.

Reimplemented from clang::PPCallbacks.

Definition at line 561 of file PPCallbacks.h.

References clang::First, and Loc.

◆ If()

void clang::PPChainedCallbacks::If ( SourceLocation  Loc,
SourceRange  ConditionRange,
ConditionValueKind  ConditionValue 
)
inlineoverridevirtual

Hook called whenever an #if is seen.

Reimplemented from clang::PPCallbacks.

Definition at line 699 of file PPCallbacks.h.

References clang::First, and Loc.

◆ Ifdef()

void clang::PPChainedCallbacks::Ifdef ( SourceLocation  Loc,
const Token MacroNameTok,
const MacroDefinition MD 
)
inlineoverridevirtual

Hook called whenever an #ifdef is seen.

Reimplemented from clang::PPCallbacks.

Definition at line 713 of file PPCallbacks.h.

References clang::First, and Loc.

◆ Ifndef()

void clang::PPChainedCallbacks::Ifndef ( SourceLocation  Loc,
const Token MacroNameTok,
const MacroDefinition MD 
)
inlineoverridevirtual

Hook called whenever an #ifndef is seen.

Reimplemented from clang::PPCallbacks.

Definition at line 733 of file PPCallbacks.h.

References clang::First, and Loc.

◆ InclusionDirective()

void clang::PPChainedCallbacks::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 
)
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.

Parameters
HashLocThe location of the '#' that starts the inclusion directive.
IncludeTokThe token that indicates the kind of inclusion directive, e.g., 'include' or 'import'.
FileNameThe name of the file being included, as written in the source code.
IsAngledWhether the file name was enclosed in angle brackets; otherwise, it was enclosed in quotes.
FilenameRangeThe character range of the quotes or angle brackets for the written file name.
FileThe actual file that may be included by this inclusion directive.
SearchPathContains 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".
RelativePathThe path relative to SearchPath, at which the include file was found. This is equal to FileName except for framework includes.
SuggestedModuleThe module suggested for this header, if any.
ModuleImportedWhether this include was translated into import of SuggestedModule.
FileTypeThe 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 523 of file PPCallbacks.h.

References clang::File, clang::FileName, and clang::First.

◆ LeftSubmodule()

void clang::PPChainedCallbacks::LeftSubmodule ( Module M,
SourceLocation  ImportLoc,
bool  ForPragma 
)
inlineoverridevirtual

Callback invoked whenever a submodule was left.

Parameters
MThe submodule we have left.
ImportLocThe location of import directive token.
ForPragmaIf entering from pragma directive.

Reimplemented from clang::PPCallbacks.

Definition at line 544 of file PPCallbacks.h.

References clang::First.

◆ LexedFileChanged()

void clang::PPChainedCallbacks::LexedFileChanged ( FileID  FID,
LexedFileChangeReason  Reason,
SrcMgr::CharacteristicKind  FileType,
FileID  PrevFID,
SourceLocation  Loc 
)
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.

Parameters
FIDThe FileID that the Lexer moved to.
ReasonWhether the Lexer entered a new file or exited one.
FileTypeThe CharacteristicKind of the file the Lexer moved to.
PrevFIDThe FileID the Lexer was using before the change.
LocThe 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 487 of file PPCallbacks.h.

References clang::First, and Loc.

◆ MacroDefined()

void clang::PPChainedCallbacks::MacroDefined ( const Token MacroNameTok,
const MacroDirective MD 
)
inlineoverridevirtual

Hook called whenever a macro definition is seen.

Reimplemented from clang::PPCallbacks.

Definition at line 674 of file PPCallbacks.h.

References clang::First.

◆ MacroExpands()

void clang::PPChainedCallbacks::MacroExpands ( const Token MacroNameTok,
const MacroDefinition MD,
SourceRange  Range,
const MacroArgs Args 
)
inlineoverridevirtual

Called by Preprocessor::HandleMacroExpandedIdentifier when a macro invocation is found.

Reimplemented from clang::PPCallbacks.

Definition at line 668 of file PPCallbacks.h.

References clang::First, and Range.

◆ MacroUndefined()

void clang::PPChainedCallbacks::MacroUndefined ( const Token MacroNameTok,
const MacroDefinition MD,
const MacroDirective Undef 
)
inlineoverridevirtual

Hook called whenever a macro #undef is seen.

Parameters
MacroNameTokThe active Token
MDA MacroDefinition for the named macro.
UndefNew MacroDirective if the macro was defined, null otherwise.

MD is released immediately following this callback.

Reimplemented from clang::PPCallbacks.

Definition at line 680 of file PPCallbacks.h.

References clang::First.

◆ moduleImport()

void clang::PPChainedCallbacks::moduleImport ( SourceLocation  ImportLoc,
ModuleIdPath  Path,
const Module Imported 
)
inlineoverridevirtual

Callback invoked whenever there was an explicit module-import syntax.

Parameters
ImportLocThe location of import directive token.
PathThe identifiers (and their locations) of the module "path", e.g., "std.vector" would be split into "std" and "vector".
ImportedThe imported module; can be null if importing failed.

Reimplemented from clang::PPCallbacks.

Definition at line 550 of file PPCallbacks.h.

References clang::First, and Path.

◆ PragmaAssumeNonNullBegin()

void clang::PPChainedCallbacks::PragmaAssumeNonNullBegin ( SourceLocation  Loc)
inlineoverridevirtual

Callback invoked when a #pragma clang assume_nonnull begin directive is read.

Reimplemented from clang::PPCallbacks.

Definition at line 658 of file PPCallbacks.h.

References clang::First, and Loc.

◆ PragmaAssumeNonNullEnd()

void clang::PPChainedCallbacks::PragmaAssumeNonNullEnd ( SourceLocation  Loc)
inlineoverridevirtual

Callback invoked when a #pragma clang assume_nonnull end directive is read.

Reimplemented from clang::PPCallbacks.

Definition at line 663 of file PPCallbacks.h.

References clang::First, and Loc.

◆ PragmaComment()

void clang::PPChainedCallbacks::PragmaComment ( SourceLocation  Loc,
const IdentifierInfo Kind,
StringRef  Str 
)
inlineoverridevirtual

Callback invoked when a #pragma comment directive is read.

Reimplemented from clang::PPCallbacks.

Definition at line 572 of file PPCallbacks.h.

References clang::First, Kind, and Loc.

◆ PragmaDebug()

void clang::PPChainedCallbacks::PragmaDebug ( SourceLocation  Loc,
StringRef  DebugType 
)
inlineoverridevirtual

Callback invoked when a #pragma clang __debug directive is read.

Parameters
LocThe location of the debug directive.
DebugTypeThe identifier following __debug.

Reimplemented from clang::PPCallbacks.

Definition at line 589 of file PPCallbacks.h.

References clang::First, and Loc.

◆ PragmaDetectMismatch()

void clang::PPChainedCallbacks::PragmaDetectMismatch ( SourceLocation  Loc,
StringRef  Name,
StringRef  Value 
)
inlineoverridevirtual

Callback invoked when a #pragma detect_mismatch directive is read.

Reimplemented from clang::PPCallbacks.

Definition at line 583 of file PPCallbacks.h.

References clang::First, and Loc.

◆ PragmaDiagnostic()

void clang::PPChainedCallbacks::PragmaDiagnostic ( SourceLocation  Loc,
StringRef  Namespace,
diag::Severity  mapping,
StringRef  Str 
)
inlineoverridevirtual

Callback invoked when a #pragma gcc diagnostic directive is read.

Reimplemented from clang::PPCallbacks.

Definition at line 610 of file PPCallbacks.h.

References clang::First, and Loc.

◆ PragmaDiagnosticPop()

void clang::PPChainedCallbacks::PragmaDiagnosticPop ( SourceLocation  Loc,
StringRef  Namespace 
)
inlineoverridevirtual

Callback invoked when a #pragma gcc diagnostic pop directive is read.

Reimplemented from clang::PPCallbacks.

Definition at line 605 of file PPCallbacks.h.

References clang::First, and Loc.

◆ PragmaDiagnosticPush()

void clang::PPChainedCallbacks::PragmaDiagnosticPush ( SourceLocation  Loc,
StringRef  Namespace 
)
inlineoverridevirtual

Callback invoked when a #pragma gcc diagnostic push directive is read.

Reimplemented from clang::PPCallbacks.

Definition at line 600 of file PPCallbacks.h.

References clang::First, and Loc.

◆ PragmaDirective()

void clang::PPChainedCallbacks::PragmaDirective ( SourceLocation  Loc,
PragmaIntroducerKind  Introducer 
)
inlineoverridevirtual

Callback invoked when start reading any pragma directive.

Reimplemented from clang::PPCallbacks.

Definition at line 566 of file PPCallbacks.h.

References clang::First, and Loc.

◆ PragmaExecCharsetPop()

void clang::PPChainedCallbacks::PragmaExecCharsetPop ( SourceLocation  Loc)
inlineoverridevirtual

Callback invoked when a #pragma execution_character_set(pop) directive is read.

Reimplemented from clang::PPCallbacks.

Definition at line 653 of file PPCallbacks.h.

References clang::First, and Loc.

◆ PragmaExecCharsetPush()

void clang::PPChainedCallbacks::PragmaExecCharsetPush ( SourceLocation  Loc,
StringRef  Str 
)
inlineoverridevirtual

Callback invoked when a #pragma execution_character_set(push) directive is read.

Reimplemented from clang::PPCallbacks.

Definition at line 648 of file PPCallbacks.h.

References clang::First, and Loc.

◆ PragmaMark()

void clang::PPChainedCallbacks::PragmaMark ( SourceLocation  Loc,
StringRef  Trivia 
)
inlineoverridevirtual

Callback invoked when a #pragma mark comment is read.

Reimplemented from clang::PPCallbacks.

Definition at line 578 of file PPCallbacks.h.

References clang::First, and Loc.

◆ PragmaMessage()

void clang::PPChainedCallbacks::PragmaMessage ( SourceLocation  Loc,
StringRef  Namespace,
PragmaMessageKind  Kind,
StringRef  Str 
)
inlineoverridevirtual

Callback invoked when a #pragma message directive is read.

Parameters
LocThe location of the message directive.
NamespaceThe namespace of the message directive.
KindThe type of the message directive.
StrThe text of the message directive.

Reimplemented from clang::PPCallbacks.

Definition at line 594 of file PPCallbacks.h.

References clang::First, Kind, and Loc.

◆ PragmaOpenCLExtension()

void clang::PPChainedCallbacks::PragmaOpenCLExtension ( SourceLocation  NameLoc,
const IdentifierInfo Name,
SourceLocation  StateLoc,
unsigned  State 
)
inlineoverridevirtual

Called when an OpenCL extension is either disabled or enabled with a pragma.

Reimplemented from clang::PPCallbacks.

Definition at line 626 of file PPCallbacks.h.

References clang::First.

◆ PragmaWarning()

void clang::PPChainedCallbacks::PragmaWarning ( SourceLocation  Loc,
PragmaWarningSpecifier  WarningSpec,
ArrayRef< int Ids 
)
inlineoverridevirtual

Reimplemented from clang::PPCallbacks.

Definition at line 632 of file PPCallbacks.h.

References clang::First, and Loc.

◆ PragmaWarningPop()

void clang::PPChainedCallbacks::PragmaWarningPop ( SourceLocation  Loc)
inlineoverridevirtual

Callback invoked when a #pragma warning(pop) directive is read.

Reimplemented from clang::PPCallbacks.

Definition at line 643 of file PPCallbacks.h.

References clang::First, and Loc.

◆ PragmaWarningPush()

void clang::PPChainedCallbacks::PragmaWarningPush ( SourceLocation  Loc,
int  Level 
)
inlineoverridevirtual

Callback invoked when a #pragma warning(push) directive is read.

Reimplemented from clang::PPCallbacks.

Definition at line 638 of file PPCallbacks.h.

References clang::First, and Loc.

◆ SourceRangeSkipped()

void clang::PPChainedCallbacks::SourceRangeSkipped ( SourceRange  Range,
SourceLocation  EndifLoc 
)
inlineoverridevirtual

Hook called when a source range is skipped.

Parameters
RangeThe SourceRange that was skipped. The range begins at the #if/#else directive and ends after the #endif/#else directive.
EndifLocThe 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 693 of file PPCallbacks.h.

References clang::First, and Range.


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