class PPCallbacks

Declaration

class PPCallbacks { /* full declaration omitted */ };

Description

This interface provides a way to observe the actions of the preprocessor as it does its thing. Clients can define their hooks here to implement preprocessor level tools.

Declared at: clang/include/clang/Lex/PPCallbacks.h:35

Method Overview

  • public virtual void Defined(const clang::Token & MacroNameTok, const clang::MacroDefinition & MD, clang::SourceRange Range)
  • public virtual void Elif(clang::SourceLocation Loc, clang::SourceRange ConditionRange, clang::PPCallbacks::ConditionValueKind ConditionValue, clang::SourceLocation IfLoc)
  • public virtual void Elifdef(clang::SourceLocation Loc, clang::SourceRange ConditionRange, clang::SourceLocation IfLoc)
  • public virtual void Elifdef(clang::SourceLocation Loc, const clang::Token & MacroNameTok, const clang::MacroDefinition & MD)
  • public virtual void Elifndef(clang::SourceLocation Loc, clang::SourceRange ConditionRange, clang::SourceLocation IfLoc)
  • public virtual void Elifndef(clang::SourceLocation Loc, const clang::Token & MacroNameTok, const clang::MacroDefinition & MD)
  • public virtual void Else(clang::SourceLocation Loc, clang::SourceLocation IfLoc)
  • public virtual void EndOfMainFile()
  • public virtual void Endif(clang::SourceLocation Loc, clang::SourceLocation IfLoc)
  • public virtual void EnteredSubmodule(clang::Module * M, clang::SourceLocation ImportLoc, bool ForPragma)
  • public virtual void FileChanged(clang::SourceLocation Loc, clang::PPCallbacks::FileChangeReason Reason, SrcMgr::CharacteristicKind FileType, clang::FileID PrevFID = clang::FileID())
  • public virtual void FileSkipped(const clang::FileEntryRef & SkippedFile, const clang::Token & FilenameTok, SrcMgr::CharacteristicKind FileType)
  • public virtual void HasInclude(clang::SourceLocation Loc, llvm::StringRef FileName, bool IsAngled, Optional<clang::FileEntryRef> File, SrcMgr::CharacteristicKind FileType)
  • public virtual void Ident(clang::SourceLocation Loc, llvm::StringRef str)
  • public virtual void If(clang::SourceLocation Loc, clang::SourceRange ConditionRange, clang::PPCallbacks::ConditionValueKind ConditionValue)
  • public virtual void Ifdef(clang::SourceLocation Loc, const clang::Token & MacroNameTok, const clang::MacroDefinition & MD)
  • public virtual void Ifndef(clang::SourceLocation Loc, const clang::Token & MacroNameTok, const clang::MacroDefinition & MD)
  • public virtual void InclusionDirective(clang::SourceLocation HashLoc, const clang::Token & IncludeTok, llvm::StringRef FileName, bool IsAngled, clang::CharSourceRange FilenameRange, Optional<clang::FileEntryRef> File, llvm::StringRef SearchPath, llvm::StringRef RelativePath, const clang::Module * Imported, SrcMgr::CharacteristicKind FileType)
  • public virtual void LeftSubmodule(clang::Module * M, clang::SourceLocation ImportLoc, bool ForPragma)
  • public virtual void LexedFileChanged(clang::FileID FID, clang::PPCallbacks::LexedFileChangeReason Reason, SrcMgr::CharacteristicKind FileType, clang::FileID PrevFID, clang::SourceLocation Loc)
  • public virtual void MacroDefined(const clang::Token & MacroNameTok, const clang::MacroDirective * MD)
  • public virtual void MacroExpands(const clang::Token & MacroNameTok, const clang::MacroDefinition & MD, clang::SourceRange Range, const clang::MacroArgs * Args)
  • public virtual void MacroUndefined(const clang::Token & MacroNameTok, const clang::MacroDefinition & MD, const clang::MacroDirective * Undef)
  • public virtual void PragmaAssumeNonNullBegin(clang::SourceLocation Loc)
  • public virtual void PragmaAssumeNonNullEnd(clang::SourceLocation Loc)
  • public virtual void PragmaComment(clang::SourceLocation Loc, const clang::IdentifierInfo * Kind, llvm::StringRef Str)
  • public virtual void PragmaDebug(clang::SourceLocation Loc, llvm::StringRef DebugType)
  • public virtual void PragmaDetectMismatch(clang::SourceLocation Loc, llvm::StringRef Name, llvm::StringRef Value)
  • public virtual void PragmaDiagnostic(clang::SourceLocation Loc, llvm::StringRef Namespace, diag::Severity mapping, llvm::StringRef Str)
  • public virtual void PragmaDiagnosticPop(clang::SourceLocation Loc, llvm::StringRef Namespace)
  • public virtual void PragmaDiagnosticPush(clang::SourceLocation Loc, llvm::StringRef Namespace)
  • public virtual void PragmaDirective(clang::SourceLocation Loc, clang::PragmaIntroducerKind Introducer)
  • public virtual void PragmaExecCharsetPop(clang::SourceLocation Loc)
  • public virtual void PragmaExecCharsetPush(clang::SourceLocation Loc, llvm::StringRef Str)
  • public virtual void PragmaMark(clang::SourceLocation Loc, llvm::StringRef Trivia)
  • public virtual void PragmaMessage(clang::SourceLocation Loc, llvm::StringRef Namespace, clang::PPCallbacks::PragmaMessageKind Kind, llvm::StringRef Str)
  • public virtual void PragmaOpenCLExtension(clang::SourceLocation NameLoc, const clang::IdentifierInfo * Name, clang::SourceLocation StateLoc, unsigned int State)
  • public virtual void PragmaWarning(clang::SourceLocation Loc, clang::PPCallbacks::PragmaWarningSpecifier WarningSpec, ArrayRef<int> Ids)
  • public virtual void PragmaWarningPop(clang::SourceLocation Loc)
  • public virtual void PragmaWarningPush(clang::SourceLocation Loc, int Level)
  • public virtual void SourceRangeSkipped(clang::SourceRange Range, clang::SourceLocation EndifLoc)
  • public virtual void moduleImport(clang::SourceLocation ImportLoc, clang::ModuleIdPath Path, const clang::Module * Imported)
  • public virtual ~PPCallbacks()

Methods

virtual void Defined(
    const clang::Token& MacroNameTok,
    const clang::MacroDefinition& MD,
    clang::SourceRange Range)

Description

Hook called whenever the 'defined' operator is seen.

Declared at: clang/include/clang/Lex/PPCallbacks.h:323

Parameters

const clang::Token& MacroNameTok
const clang::MacroDefinition& MD
The MacroDirective if the name was a macro, null otherwise.
clang::SourceRange Range

virtual void Elif(
    clang::SourceLocation Loc,
    clang::SourceRange ConditionRange,
    clang::PPCallbacks::ConditionValueKind
        ConditionValue,
    clang::SourceLocation IfLoc)

Description

Hook called whenever an # elif is seen.

Declared at: clang/include/clang/Lex/PPCallbacks.h:362

Parameters

clang::SourceLocation Loc
the source location of the directive.
clang::SourceRange ConditionRange
The SourceRange of the expression being tested.
clang::PPCallbacks::ConditionValueKind ConditionValue
The evaluated value of the condition.
clang::SourceLocation IfLoc
the source location of the # if/ # ifdef/ # ifndef directive.

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

Description

Hook called whenever an # elifdef is skipped.

Declared at: clang/include/clang/Lex/PPCallbacks.h:386

Parameters

clang::SourceLocation Loc
the source location of the directive.
clang::SourceRange ConditionRange
The SourceRange of the expression being tested.
clang::SourceLocation IfLoc
the source location of the # if/ # ifdef/ # ifndef directive.

virtual void Elifdef(
    clang::SourceLocation Loc,
    const clang::Token& MacroNameTok,
    const clang::MacroDefinition& MD)

Description

Hook called whenever an # elifdef branch is taken.

Declared at: clang/include/clang/Lex/PPCallbacks.h:378

Parameters

clang::SourceLocation Loc
the source location of the directive.
const clang::Token& MacroNameTok
Information on the token being tested.
const clang::MacroDefinition& MD
The MacroDefinition if the name was a macro, null otherwise.

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

Description

Hook called whenever an # elifndef is skipped.

Declared at: clang/include/clang/Lex/PPCallbacks.h:410

Parameters

clang::SourceLocation Loc
the source location of the directive.
clang::SourceRange ConditionRange
The SourceRange of the expression being tested.
clang::SourceLocation IfLoc
the source location of the # if/ # ifdef/ # ifndef directive.

virtual void Elifndef(
    clang::SourceLocation Loc,
    const clang::Token& MacroNameTok,
    const clang::MacroDefinition& MD)

Description

Hook called whenever an # elifndef branch is taken.

Declared at: clang/include/clang/Lex/PPCallbacks.h:402

Parameters

clang::SourceLocation Loc
the source location of the directive.
const clang::Token& MacroNameTok
Information on the token being tested.
const clang::MacroDefinition& MD
The MacroDefinition if the name was a macro, null otherwise.

virtual void Else(clang::SourceLocation Loc,
                  clang::SourceLocation IfLoc)

Description

Hook called whenever an # else is seen.

Declared at: clang/include/clang/Lex/PPCallbacks.h:417

Parameters

clang::SourceLocation Loc
the source location of the directive.
clang::SourceLocation IfLoc
the source location of the # if/ # ifdef/ # ifndef directive.

virtual void EndOfMainFile()

Description

Callback invoked when the end of the main file is reached. No subsequent callbacks will be made.

Declared at: clang/include/clang/Lex/PPCallbacks.h:179

virtual void Endif(clang::SourceLocation Loc,
                   clang::SourceLocation IfLoc)

Description

Hook called whenever an # endif is seen.

Declared at: clang/include/clang/Lex/PPCallbacks.h:423

Parameters

clang::SourceLocation Loc
the source location of the directive.
clang::SourceLocation IfLoc
the source location of the # if/ # ifdef/ # ifndef directive.

virtual void EnteredSubmodule(
    clang::Module* M,
    clang::SourceLocation ImportLoc,
    bool ForPragma)

Description

Callback invoked whenever a submodule was entered.

Declared at: clang/include/clang/Lex/PPCallbacks.h:147

Parameters

clang::Module* M
The submodule we have entered.
clang::SourceLocation ImportLoc
The location of import directive token.
bool ForPragma
If entering from pragma directive.

virtual void FileChanged(
    clang::SourceLocation Loc,
    clang::PPCallbacks::FileChangeReason Reason,
    SrcMgr::CharacteristicKind FileType,
    clang::FileID PrevFID = clang::FileID())

Description

Callback invoked whenever a source file is entered or exited.

Declared at: clang/include/clang/Lex/PPCallbacks.h:48

Parameters

clang::SourceLocation Loc
Indicates the new location.
clang::PPCallbacks::FileChangeReason Reason
SrcMgr::CharacteristicKind FileType
clang::FileID PrevFID = clang::FileID()
the file that was exited if \p Reason is ExitFile or the the file before the new one entered for \p Reason EnterFile.

virtual void FileSkipped(
    const clang::FileEntryRef& SkippedFile,
    const clang::Token& FilenameTok,
    SrcMgr::CharacteristicKind FileType)

Description

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

Declared at: clang/include/clang/Lex/PPCallbacks.h:82

Parameters

const clang::FileEntryRef& SkippedFile
The file that is skipped instead of entering # include
const clang::Token& 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.
SrcMgr::CharacteristicKind FileType

virtual void HasInclude(
    clang::SourceLocation Loc,
    llvm::StringRef FileName,
    bool IsAngled,
    Optional<clang::FileEntryRef> File,
    SrcMgr::CharacteristicKind FileType)

Description

Hook called when a '__has_include' or '__has_include_next' directive is read.

Declared at: clang/include/clang/Lex/PPCallbacks.h:329

Parameters

clang::SourceLocation Loc
llvm::StringRef FileName
bool IsAngled
Optional<clang::FileEntryRef> File
SrcMgr::CharacteristicKind FileType

virtual void Ident(clang::SourceLocation Loc,
                   llvm::StringRef str)

Description

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

Declared at: clang/include/clang/Lex/PPCallbacks.h:186

Parameters

clang::SourceLocation Loc
The location of the directive.
llvm::StringRef str
The text of the directive.

virtual void If(
    clang::SourceLocation Loc,
    clang::SourceRange ConditionRange,
    clang::PPCallbacks::ConditionValueKind
        ConditionValue)

Description

Hook called whenever an # if is seen.

Declared at: clang/include/clang/Lex/PPCallbacks.h:352

Parameters

clang::SourceLocation Loc
the source location of the directive.
clang::SourceRange ConditionRange
The SourceRange of the expression being tested.
clang::PPCallbacks::ConditionValueKind ConditionValue
The evaluated value of the condition.

virtual void Ifdef(
    clang::SourceLocation Loc,
    const clang::Token& MacroNameTok,
    const clang::MacroDefinition& MD)

Description

Hook called whenever an # ifdef is seen.

Declared at: clang/include/clang/Lex/PPCallbacks.h:370

Parameters

clang::SourceLocation Loc
the source location of the directive.
const clang::Token& MacroNameTok
Information on the token being tested.
const clang::MacroDefinition& MD
The MacroDefinition if the name was a macro, null otherwise.

virtual void Ifndef(
    clang::SourceLocation Loc,
    const clang::Token& MacroNameTok,
    const clang::MacroDefinition& MD)

Description

Hook called whenever an # ifndef is seen.

Declared at: clang/include/clang/Lex/PPCallbacks.h:394

Parameters

clang::SourceLocation Loc
the source location of the directive.
const clang::Token& MacroNameTok
Information on the token being tested.
const clang::MacroDefinition& MD
The MacroDefiniton if the name was a macro, null otherwise.

virtual void InclusionDirective(
    clang::SourceLocation HashLoc,
    const clang::Token& IncludeTok,
    llvm::StringRef FileName,
    bool IsAngled,
    clang::CharSourceRange FilenameRange,
    Optional<clang::FileEntryRef> File,
    llvm::StringRef SearchPath,
    llvm::StringRef RelativePath,
    const clang::Module* Imported,
    SrcMgr::CharacteristicKind FileType)

Description

Callback invoked whenever an inclusion directive of any kind (\c \#include \c \#import etc.) has been processed, regardless of whether the inclusion will actually result in an inclusion.

Declared at: clang/include/clang/Lex/PPCallbacks.h:127

Parameters

clang::SourceLocation HashLoc
The location of the '#' that starts the inclusion directive.
const clang::Token& IncludeTok
The token that indicates the kind of inclusion directive, e.g., 'include' or 'import'.
llvm::StringRef FileName
The name of the file being included, as written in the source code.
bool IsAngled
Whether the file name was enclosed in angle brackets; otherwise, it was enclosed in quotes.
clang::CharSourceRange FilenameRange
The character range of the quotes or angle brackets for the written file name.
Optional<clang::FileEntryRef> File
The actual file that may be included by this inclusion directive.
llvm::StringRef 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".
llvm::StringRef RelativePath
The path relative to SearchPath, at which the include file was found. This is equal to FileName except for framework includes.
const clang::Module* Imported
The module, whenever an inclusion directive was automatically turned into a module import or null otherwise.
SrcMgr::CharacteristicKind 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.

virtual void LeftSubmodule(
    clang::Module* M,
    clang::SourceLocation ImportLoc,
    bool ForPragma)

Description

Callback invoked whenever a submodule was left.

Declared at: clang/include/clang/Lex/PPCallbacks.h:158

Parameters

clang::Module* M
The submodule we have left.
clang::SourceLocation ImportLoc
The location of import directive token.
bool ForPragma
If entering from pragma directive.

virtual void LexedFileChanged(
    clang::FileID FID,
    clang::PPCallbacks::LexedFileChangeReason
        Reason,
    SrcMgr::CharacteristicKind FileType,
    clang::FileID PrevFID,
    clang::SourceLocation Loc)

Description

Callback invoked whenever the \p Lexer moves to a different file for lexing. Unlike \p FileChanged line number directives and other related pragmas do not trigger callbacks to \p LexedFileChanged.

Declared at: clang/include/clang/Lex/PPCallbacks.h:70

Parameters

clang::FileID FID
The \p FileID that the \p Lexer moved to.
clang::PPCallbacks::LexedFileChangeReason Reason
Whether the \p Lexer entered a new file or exited one.
SrcMgr::CharacteristicKind FileType
The \p CharacteristicKind of the file the \p Lexer moved to.
clang::FileID PrevFID
The \p FileID the \p Lexer was using before the change.
clang::SourceLocation Loc
The location where the \p Lexer entered a new file from or the location that the \p Lexer moved into after exiting a file.

virtual void MacroDefined(
    const clang::Token& MacroNameTok,
    const clang::MacroDirective* MD)

Description

Hook called whenever a macro definition is seen.

Declared at: clang/include/clang/Lex/PPCallbacks.h:306

Parameters

const clang::Token& MacroNameTok
const clang::MacroDirective* MD

virtual void MacroExpands(
    const clang::Token& MacroNameTok,
    const clang::MacroDefinition& MD,
    clang::SourceRange Range,
    const clang::MacroArgs* Args)

Description

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

Declared at: clang/include/clang/Lex/PPCallbacks.h:301

Parameters

const clang::Token& MacroNameTok
const clang::MacroDefinition& MD
clang::SourceRange Range
const clang::MacroArgs* Args

virtual void MacroUndefined(
    const clang::Token& MacroNameTok,
    const clang::MacroDefinition& MD,
    const clang::MacroDirective* Undef)

Description

Hook called whenever a macro # undef is seen. MD is released immediately following this callback.

Declared at: clang/include/clang/Lex/PPCallbacks.h:316

Parameters

const clang::Token& MacroNameTok
The active Token
const clang::MacroDefinition& MD
A MacroDefinition for the named macro.
const clang::MacroDirective* Undef
New MacroDirective if the macro was defined, null otherwise.

virtual void PragmaAssumeNonNullBegin(
    clang::SourceLocation Loc)

Description

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

Declared at: clang/include/clang/Lex/PPCallbacks.h:293

Parameters

clang::SourceLocation Loc

virtual void PragmaAssumeNonNullEnd(
    clang::SourceLocation Loc)

Description

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

Declared at: clang/include/clang/Lex/PPCallbacks.h:297

Parameters

clang::SourceLocation Loc

virtual void PragmaComment(
    clang::SourceLocation Loc,
    const clang::IdentifierInfo* Kind,
    llvm::StringRef Str)

Description

Callback invoked when a # pragma comment directive is read.

Declared at: clang/include/clang/Lex/PPCallbacks.h:195

Parameters

clang::SourceLocation Loc
const clang::IdentifierInfo* Kind
llvm::StringRef Str

virtual void PragmaDebug(
    clang::SourceLocation Loc,
    llvm::StringRef DebugType)

Description

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

Declared at: clang/include/clang/Lex/PPCallbacks.h:212

Parameters

clang::SourceLocation Loc
The location of the debug directive.
llvm::StringRef DebugType
The identifier following __debug.

virtual void PragmaDetectMismatch(
    clang::SourceLocation Loc,
    llvm::StringRef Name,
    llvm::StringRef Value)

Description

Callback invoked when a # pragma detect_mismatch directive is read.

Declared at: clang/include/clang/Lex/PPCallbacks.h:205

Parameters

clang::SourceLocation Loc
llvm::StringRef Name
llvm::StringRef Value

virtual void PragmaDiagnostic(
    clang::SourceLocation Loc,
    llvm::StringRef Namespace,
    diag::Severity mapping,
    llvm::StringRef Str)

Description

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

Declared at: clang/include/clang/Lex/PPCallbacks.h:249

Parameters

clang::SourceLocation Loc
llvm::StringRef Namespace
diag::Severity mapping
llvm::StringRef Str

virtual void PragmaDiagnosticPop(
    clang::SourceLocation Loc,
    llvm::StringRef Namespace)

Description

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

Declared at: clang/include/clang/Lex/PPCallbacks.h:244

Parameters

clang::SourceLocation Loc
llvm::StringRef Namespace

virtual void PragmaDiagnosticPush(
    clang::SourceLocation Loc,
    llvm::StringRef Namespace)

Description

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

Declared at: clang/include/clang/Lex/PPCallbacks.h:238

Parameters

clang::SourceLocation Loc
llvm::StringRef Namespace

virtual void PragmaDirective(
    clang::SourceLocation Loc,
    clang::PragmaIntroducerKind Introducer)

Description

Callback invoked when start reading any pragma directive.

Declared at: clang/include/clang/Lex/PPCallbacks.h:190

Parameters

clang::SourceLocation Loc
clang::PragmaIntroducerKind Introducer

virtual void PragmaExecCharsetPop(
    clang::SourceLocation Loc)

Description

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

Declared at: clang/include/clang/Lex/PPCallbacks.h:289

Parameters

clang::SourceLocation Loc

virtual void PragmaExecCharsetPush(
    clang::SourceLocation Loc,
    llvm::StringRef Str)

Description

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

Declared at: clang/include/clang/Lex/PPCallbacks.h:285

Parameters

clang::SourceLocation Loc
llvm::StringRef Str

virtual void PragmaMark(clang::SourceLocation Loc,
                        llvm::StringRef Trivia)

Description

Callback invoked when a # pragma mark comment is read.

Declared at: clang/include/clang/Lex/PPCallbacks.h:200

Parameters

clang::SourceLocation Loc
llvm::StringRef Trivia

virtual void PragmaMessage(
    clang::SourceLocation Loc,
    llvm::StringRef Namespace,
    clang::PPCallbacks::PragmaMessageKind Kind,
    llvm::StringRef Str)

Description

Callback invoked when a # pragma message directive is read.

Declared at: clang/include/clang/Lex/PPCallbacks.h:232

Parameters

clang::SourceLocation Loc
The location of the message directive.
llvm::StringRef Namespace
The namespace of the message directive.
clang::PPCallbacks::PragmaMessageKind Kind
The type of the message directive.
llvm::StringRef Str
The text of the message directive.

virtual void PragmaOpenCLExtension(
    clang::SourceLocation NameLoc,
    const clang::IdentifierInfo* Name,
    clang::SourceLocation StateLoc,
    unsigned int State)

Description

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

Declared at: clang/include/clang/Lex/PPCallbacks.h:254

Parameters

clang::SourceLocation NameLoc
const clang::IdentifierInfo* Name
clang::SourceLocation StateLoc
unsigned int State

virtual void PragmaWarning(
    clang::SourceLocation Loc,
    clang::PPCallbacks::PragmaWarningSpecifier
        WarningSpec,
    ArrayRef<int> Ids)

Declared at: clang/include/clang/Lex/PPCallbacks.h:271

Parameters

clang::SourceLocation Loc
clang::PPCallbacks::PragmaWarningSpecifier WarningSpec
ArrayRef<int> Ids

virtual void PragmaWarningPop(
    clang::SourceLocation Loc)

Description

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

Declared at: clang/include/clang/Lex/PPCallbacks.h:280

Parameters

clang::SourceLocation Loc

virtual void PragmaWarningPush(
    clang::SourceLocation Loc,
    int Level)

Description

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

Declared at: clang/include/clang/Lex/PPCallbacks.h:276

Parameters

clang::SourceLocation Loc
int Level

virtual void SourceRangeSkipped(
    clang::SourceRange Range,
    clang::SourceLocation EndifLoc)

Description

Hook called when a source range is skipped.

Declared at: clang/include/clang/Lex/PPCallbacks.h:339

Parameters

clang::SourceRange Range
The SourceRange that was skipped. The range begins at the # if/ # else directive and ends after the # endif/ # else directive.
clang::SourceLocation EndifLoc
The end location of the 'endif' token, which may precede the range skipped by the directive (e.g excluding comments after an 'endif').

virtual void moduleImport(
    clang::SourceLocation ImportLoc,
    clang::ModuleIdPath Path,
    const clang::Module* Imported)

Description

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

Declared at: clang/include/clang/Lex/PPCallbacks.h:171

Parameters

clang::SourceLocation ImportLoc
The location of import directive token.
clang::ModuleIdPath Path
The identifiers (and their locations) of the module "path", e.g., "std.vector" would be split into "std" and "vector".
const clang::Module* Imported
The imported module; can be null if importing failed.

virtual ~PPCallbacks()

Declared at: clang/include/clang/Lex/PPCallbacks.h:37