clang 18.0.0git
|
Each ExpansionInfo encodes the expansion location - where the token was ultimately expanded, and the SpellingLoc - where the actual character data for the token came from. More...
#include "clang/Basic/SourceManager.h"
Public Member Functions | |
SourceLocation | getSpellingLoc () const |
SourceLocation | getExpansionLocStart () const |
SourceLocation | getExpansionLocEnd () const |
bool | isExpansionTokenRange () const |
CharSourceRange | getExpansionLocRange () const |
bool | isMacroArgExpansion () const |
bool | isMacroBodyExpansion () const |
bool | isFunctionMacroExpansion () const |
Static Public Member Functions | |
static ExpansionInfo | create (SourceLocation SpellingLoc, SourceLocation Start, SourceLocation End, bool ExpansionIsTokenRange=true) |
Return a ExpansionInfo for an expansion. | |
static ExpansionInfo | createForMacroArg (SourceLocation SpellingLoc, SourceLocation ExpansionLoc) |
Return a special ExpansionInfo for the expansion of a macro argument into a function-like macro's body. | |
static ExpansionInfo | createForTokenSplit (SourceLocation SpellingLoc, SourceLocation Start, SourceLocation End) |
Return a special ExpansionInfo representing a token that ends prematurely. | |
Each ExpansionInfo encodes the expansion location - where the token was ultimately expanded, and the SpellingLoc - where the actual character data for the token came from.
Definition at line 356 of file SourceManager.h.
|
inlinestatic |
Return a ExpansionInfo for an expansion.
Start and End specify the expansion range (where the macro is expanded), and SpellingLoc specifies the spelling location (where the characters from the token come from). All three can refer to normal File SLocs or expansion locations.
Definition at line 415 of file SourceManager.h.
References X.
Referenced by clang::SourceManager::createExpansionLoc(), createForMacroArg(), and createForTokenSplit().
|
inlinestatic |
Return a special ExpansionInfo for the expansion of a macro argument into a function-like macro's body.
ExpansionLoc specifies the expansion location (where the macro is expanded). This doesn't need to be a range because a macro is always expanded at a macro parameter reference, and macro parameters are always exactly one token. SpellingLoc specifies the spelling location (where the characters from the token come from). ExpansionLoc and SpellingLoc can both refer to normal File SLocs or expansion locations.
Given the code:
When expanding 'F(42)'
, the 'x'
would call this with an SpellingLoc pointing at '42'
and an ExpansionLoc pointing at its location in the definition of 'F'
.
Definition at line 445 of file SourceManager.h.
References create().
Referenced by clang::SourceManager::createMacroArgExpansionLoc().
|
inlinestatic |
Return a special ExpansionInfo representing a token that ends prematurely.
This is used to model a '>>' token that has been split into '>' tokens and similar cases. Unlike for the other forms of expansion, the expansion range in this case is a character range, not a token range.
Definition at line 458 of file SourceManager.h.
References create().
Referenced by clang::SourceManager::createTokenSplitLoc().
|
inline |
Definition at line 382 of file SourceManager.h.
References getExpansionLocStart(), and clang::SourceLocation::isInvalid().
Referenced by getExpansionLocRange(), clang::ASTImporter::Import(), clang::SourceManager::isAtEndOfImmediateMacroExpansion(), and isFunctionMacroExpansion().
|
inline |
Definition at line 389 of file SourceManager.h.
References getExpansionLocEnd(), getExpansionLocStart(), and isExpansionTokenRange().
Referenced by clang::SourceManager::getImmediateExpansionRange().
|
inline |
Definition at line 378 of file SourceManager.h.
Referenced by clang::SourceManager::getDecomposedIncludedLoc(), getExpansionLocEnd(), clang::ast_matchers::internal::getExpansionLocOfMacro(), getExpansionLocRange(), clang::Lexer::getImmediateMacroName(), getSpellingLoc(), clang::ASTImporter::Import(), clang::SourceManager::isAtEndOfImmediateMacroExpansion(), clang::SourceManager::isAtStartOfImmediateMacroExpansion(), isFunctionMacroExpansion(), isMacroArgExpansion(), clang::SourceManager::isMacroArgExpansion(), isMacroBodyExpansion(), and clang::Lexer::makeFileCharRange().
|
inline |
Definition at line 374 of file SourceManager.h.
References getExpansionLocStart(), and clang::SourceLocation::isInvalid().
Referenced by clang::ast_matchers::internal::getExpansionLocOfMacro(), clang::Lexer::getImmediateMacroName(), clang::SourceManager::getImmediateSpellingLoc(), and clang::ASTImporter::Import().
|
inline |
Definition at line 387 of file SourceManager.h.
Referenced by getExpansionLocRange(), and clang::ASTImporter::Import().
|
inline |
Definition at line 404 of file SourceManager.h.
References getExpansionLocEnd(), getExpansionLocStart(), and clang::SourceLocation::isValid().
Referenced by EvaluateDefined(), and isFunctionMacroExpansion().
|
inline |
Definition at line 395 of file SourceManager.h.
References getExpansionLocStart(), clang::SourceLocation::isInvalid(), and clang::SourceLocation::isValid().
Referenced by clang::ast_matchers::internal::getExpansionLocOfMacro(), clang::Lexer::getImmediateMacroName(), clang::ASTImporter::Import(), clang::SourceManager::isAtEndOfImmediateMacroExpansion(), clang::SourceManager::isAtStartOfImmediateMacroExpansion(), clang::SourceManager::isMacroArgExpansion(), and clang::Lexer::makeFileCharRange().
|
inline |
Definition at line 400 of file SourceManager.h.
References getExpansionLocStart(), and clang::SourceLocation::isValid().
Referenced by clang::SourceManager::isMacroBodyExpansion().