class TokenCollector::CollectPPExpansions

Declaration

class TokenCollector::CollectPPExpansions : public PPCallbacks { /* full declaration omitted */ };

Description

Records information reqired to construct mappings for the token buffer that we are collecting.

Declared at: clang/lib/Tooling/Syntax/Tokens.cpp:663

Inherits from: PPCallbacks

Member Variables

private clang::syntax::TokenCollector* Collector
private clang::SourceLocation LastExpansionEnd
Used to detect recursive macro expansions.

Method Overview

  • public CollectPPExpansions(clang::syntax::TokenCollector & C)
  • public void MacroExpands(const clang::Token & MacroNameTok, const clang::MacroDefinition & MD, clang::SourceRange Range, const clang::MacroArgs * Args)
  • public void disable()

Inherited from PPCallbacks:

Methods

CollectPPExpansions(
    clang::syntax::TokenCollector& C)

Declared at: clang/lib/Tooling/Syntax/Tokens.cpp:665

Parameters

clang::syntax::TokenCollector& C

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/lib/Tooling/Syntax/Tokens.cpp:672

Parameters

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

void disable()

Description

Disabled instance will stop reporting anything to TokenCollector. This ensures that uses of the preprocessor after TokenCollector::consume() is called do not access the (possibly invalid) collector instance.

Declared at: clang/lib/Tooling/Syntax/Tokens.cpp:670