clang: clang::MacroDirective Class Reference (original) (raw)

Encapsulates changes to the "macros namespace" (the location where the macro name became active, the location where it was undefined, etc.). More...

#include "[clang/Lex/MacroInfo.h](MacroInfo%5F8h%5Fsource.html)"

Public Member Functions
Kind getKind () const
SourceLocation getLocation () const
void setPrevious (MacroDirective *Prev)
Set previous definition of the macro with the same name.
const MacroDirective * getPrevious () const
Get previous definition of the macro with the same name.
MacroDirective * getPrevious ()
Get previous definition of the macro with the same name.
bool isFromPCH () const
Return true if the macro directive was loaded from a PCH file.
void setIsFromPCH ()
DefInfo getDefinition ()
Traverses the macro directives history and returns the next macro definition directive along with info about its undefined location (if there is one) and if it is public or private.
const DefInfo getDefinition () const
bool isDefined () const
const MacroInfo * getMacroInfo () const
MacroInfo * getMacroInfo ()
const DefInfo findDirectiveAtLoc (SourceLocation L, const SourceManager &SM) const
Find macro definition active in the specified source location.
void dump () const
Protected Attributes
MacroDirective * Previous = nullptr
Previous macro directive for the same identifier, or nullptr.
SourceLocation Loc
unsigned MDKind: 2
[MacroDirective](classclang%5F1%5F1MacroDirective.html "Encapsulates changes to the "macros namespace" (the location where the macro name became active,...") kind.
unsigned IsFromPCH: 1
True if the macro directive was loaded from a PCH file.
unsigned IsPublic: 1
Whether the macro has public visibility (when described in a module).

Encapsulates changes to the "macros namespace" (the location where the macro name became active, the location where it was undefined, etc.).

MacroDirectives, associated with an identifier, are used to model the macro history. Usually a macro definition (MacroInfo) is where a macro name becomes active ([MacroDirective](classclang%5F1%5F1MacroDirective.html "Encapsulates changes to the "macros namespace" (the location where the macro name became active,...")) but #pragma push_macro / pop_macro can create additional DefMacroDirectives for the same MacroInfo.

Definition at line 313 of file MacroInfo.h.

Kind

Enumerator
MD_Define
MD_Undefine
MD_Visibility

Definition at line 315 of file MacroInfo.h.

classof()

dump()

LLVM_DUMP_METHOD void MacroDirective::dump ( ) const

findDirectiveAtLoc()

getDefinition() [1/2]

getDefinition() [2/2]

const DefInfo clang::MacroDirective::getDefinition ( ) const inline

getKind()

Kind clang::MacroDirective::getKind ( ) const inline

getLocation()

getMacroInfo() [1/2]

MacroInfo * clang::MacroDirective::getMacroInfo ( ) inline

getMacroInfo() [2/2]

const MacroInfo * clang::MacroDirective::getMacroInfo ( ) const inline

getPrevious() [1/2]

Get previous definition of the macro with the same name.

Definition at line 357 of file MacroInfo.h.

References Previous.

getPrevious() [2/2]

const MacroDirective * clang::MacroDirective::getPrevious ( ) const inline

isDefined()

bool clang::MacroDirective::isDefined ( ) const inline

isFromPCH()

bool clang::MacroDirective::isFromPCH ( ) const inline

Return true if the macro directive was loaded from a PCH file.

Definition at line 360 of file MacroInfo.h.

References IsFromPCH.

setIsFromPCH()

void clang::MacroDirective::setIsFromPCH ( ) inline

setPrevious()

void clang::MacroDirective::setPrevious ( MacroDirective * Prev) inline

IsFromPCH

unsigned clang::MacroDirective::IsFromPCH protected

IsPublic

unsigned clang::MacroDirective::IsPublic protected

Loc

MDKind

Previous


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