class PPConditionalDirectiveRecord
Declaration
class PPConditionalDirectiveRecord : public PPCallbacks { /* full declaration omitted */ };
Description
Records preprocessor conditional directive regions and allows querying in which region source locations belong to.
Declared at: clang/include/clang/Lex/PPConditionalDirectiveRecord.h:25
Inherits from: PPCallbacks
Member Variables
- private clang::SourceManager& SourceMgr
- private SmallVector<clang::SourceLocation, 6> CondDirectiveStack
- private clang::PPConditionalDirectiveRecord:: CondDirectiveLocsTy CondDirectiveLocs
- The locations of conditional directives in source order.
Method Overview
- private void Elif(clang::SourceLocation Loc, clang::SourceRange ConditionRange, clang::PPCallbacks::ConditionValueKind ConditionValue, clang::SourceLocation IfLoc)
- private void Elifdef(clang::SourceLocation Loc, clang::SourceRange ConditionRange, clang::SourceLocation IfLoc)
- private void Elifdef(clang::SourceLocation Loc, const clang::Token & MacroNameTok, const clang::MacroDefinition & MD)
- private void Elifndef(clang::SourceLocation Loc, clang::SourceRange ConditionRange, clang::SourceLocation IfLoc)
- private void Elifndef(clang::SourceLocation Loc, const clang::Token & MacroNameTok, const clang::MacroDefinition & MD)
- private void Else(clang::SourceLocation Loc, clang::SourceLocation IfLoc)
- private void Endif(clang::SourceLocation Loc, clang::SourceLocation IfLoc)
- private void If(clang::SourceLocation Loc, clang::SourceRange ConditionRange, clang::PPCallbacks::ConditionValueKind ConditionValue)
- private void Ifdef(clang::SourceLocation Loc, const clang::Token & MacroNameTok, const clang::MacroDefinition & MD)
- private void Ifndef(clang::SourceLocation Loc, const clang::Token & MacroNameTok, const clang::MacroDefinition & MD)
- public PPConditionalDirectiveRecord(clang::SourceManager & SM)
- private void addCondDirectiveLoc(clang::PPConditionalDirectiveRecord::CondDirectiveLoc DirLoc)
- public bool areInDifferentConditionalDirectiveRegion(clang::SourceLocation LHS, clang::SourceLocation RHS) const
- public clang::SourceLocation findConditionalDirectiveRegionLoc(clang::SourceLocation Loc) const
- public clang::SourceManager & getSourceManager() const
- public size_t getTotalMemory() const
- public bool rangeIntersectsConditionalDirective(clang::SourceRange Range) const
Inherited from PPCallbacks:
- public Defined
- public Elif
- public Elifdef
- public Elifdef
- public Elifndef
- public Elifndef
- public Else
- public EndOfMainFile
- public Endif
- public EnteredSubmodule
- public FileChanged
- public FileSkipped
- public HasInclude
- public Ident
- public If
- public Ifdef
- public Ifndef
- public InclusionDirective
- public LeftSubmodule
- public LexedFileChanged
- public MacroDefined
- public MacroExpands
- public MacroUndefined
- public PragmaAssumeNonNullBegin
- public PragmaAssumeNonNullEnd
- public PragmaComment
- public PragmaDebug
- public PragmaDetectMismatch
- public PragmaDiagnostic
- public PragmaDiagnosticPop
- public PragmaDiagnosticPush
- public PragmaDirective
- public PragmaExecCharsetPop
- public PragmaExecCharsetPush
- public PragmaMark
- public PragmaMessage
- public PragmaOpenCLExtension
- public PragmaWarning
- public PragmaWarningPop
- public PragmaWarningPush
- public SourceRangeSkipped
- public moduleImport
Methods
¶void Elif(clang::SourceLocation Loc,
clang::SourceRange ConditionRange,
clang::PPCallbacks::ConditionValueKind
ConditionValue,
clang::SourceLocation IfLoc)
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/PPConditionalDirectiveRecord.h:90
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.
¶void Elifdef(clang::SourceLocation Loc,
clang::SourceRange ConditionRange,
clang::SourceLocation IfLoc)
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/PPConditionalDirectiveRecord.h:98
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.
¶void Elifdef(clang::SourceLocation Loc,
const clang::Token& MacroNameTok,
const clang::MacroDefinition& MD)
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/PPConditionalDirectiveRecord.h:96
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.
¶void Elifndef(clang::SourceLocation Loc,
clang::SourceRange ConditionRange,
clang::SourceLocation IfLoc)
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/PPConditionalDirectiveRecord.h:102
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.
¶void Elifndef(clang::SourceLocation Loc,
const clang::Token& MacroNameTok,
const clang::MacroDefinition& MD)
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/PPConditionalDirectiveRecord.h:100
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.
¶void Else(clang::SourceLocation Loc,
clang::SourceLocation IfLoc)
void Else(clang::SourceLocation Loc,
clang::SourceLocation IfLoc)
Description
Hook called whenever an # else is seen.
Declared at: clang/include/clang/Lex/PPConditionalDirectiveRecord.h:104
Parameters
- clang::SourceLocation Loc
- the source location of the directive.
- clang::SourceLocation IfLoc
- the source location of the # if/ # ifdef/ # ifndef directive.
¶void Endif(clang::SourceLocation Loc,
clang::SourceLocation IfLoc)
void Endif(clang::SourceLocation Loc,
clang::SourceLocation IfLoc)
Description
Hook called whenever an # endif is seen.
Declared at: clang/include/clang/Lex/PPConditionalDirectiveRecord.h:105
Parameters
- clang::SourceLocation Loc
- the source location of the directive.
- clang::SourceLocation IfLoc
- the source location of the # if/ # ifdef/ # ifndef directive.
¶void If(clang::SourceLocation Loc,
clang::SourceRange ConditionRange,
clang::PPCallbacks::ConditionValueKind
ConditionValue)
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/PPConditionalDirectiveRecord.h:88
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.
¶void Ifdef(clang::SourceLocation Loc,
const clang::Token& MacroNameTok,
const clang::MacroDefinition& MD)
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/PPConditionalDirectiveRecord.h:92
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.
¶void Ifndef(clang::SourceLocation Loc,
const clang::Token& MacroNameTok,
const clang::MacroDefinition& MD)
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/PPConditionalDirectiveRecord.h:94
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.
¶PPConditionalDirectiveRecord(
clang::SourceManager& SM)
PPConditionalDirectiveRecord(
clang::SourceManager& SM)
Description
Construct a new preprocessing record.
Declared at: clang/include/clang/Lex/PPConditionalDirectiveRecord.h:66
Parameters
¶void addCondDirectiveLoc(
clang::PPConditionalDirectiveRecord::
CondDirectiveLoc DirLoc)
void addCondDirectiveLoc(
clang::PPConditionalDirectiveRecord::
CondDirectiveLoc DirLoc)
Declared at: clang/include/clang/Lex/PPConditionalDirectiveRecord.h:62
Parameters
- clang::PPConditionalDirectiveRecord:: CondDirectiveLoc DirLoc
¶bool areInDifferentConditionalDirectiveRegion(
clang::SourceLocation LHS,
clang::SourceLocation RHS) const
bool areInDifferentConditionalDirectiveRegion(
clang::SourceLocation LHS,
clang::SourceLocation RHS) const
Description
Returns true if the given locations are in different regions, separated by conditional directive blocks.
Declared at: clang/include/clang/Lex/PPConditionalDirectiveRecord.h:79
Parameters
¶clang::SourceLocation
findConditionalDirectiveRegionLoc(
clang::SourceLocation Loc) const
clang::SourceLocation
findConditionalDirectiveRegionLoc(
clang::SourceLocation Loc) const
Declared at: clang/include/clang/Lex/PPConditionalDirectiveRecord.h:85
Parameters
¶clang::SourceManager& getSourceManager() const
clang::SourceManager& getSourceManager() const
Declared at: clang/include/clang/Lex/PPConditionalDirectiveRecord.h:70
¶size_t getTotalMemory() const
size_t getTotalMemory() const
Declared at: clang/include/clang/Lex/PPConditionalDirectiveRecord.h:68
¶bool rangeIntersectsConditionalDirective(
clang::SourceRange Range) const
bool rangeIntersectsConditionalDirective(
clang::SourceRange Range) const
Description
Returns true if the given range intersects with a conditional directive. if a # if/ # endif block is fully contained within the range, this function will return false.
Declared at: clang/include/clang/Lex/PPConditionalDirectiveRecord.h:75
Parameters
- clang::SourceRange Range