clang
3.7.0
|
Encapsulates changes to the "macros namespace" (the location where the macro name became active, the location where it was undefined, etc.). More...
#include <MacroInfo.h>
Classes | |
class | DefInfo |
Public Types | |
enum | Kind { MD_Define, MD_Undefine, MD_Visibility } |
Public Member Functions | |
Kind | getKind () const |
SourceLocation | getLocation () const |
void | setPrevious (MacroDirective *Prev) |
Set previous definition of the macro with the same name. More... | |
const MacroDirective * | getPrevious () const |
Get previous definition of the macro with the same name. More... | |
MacroDirective * | getPrevious () |
Get previous definition of the macro with the same name. More... | |
bool | isFromPCH () const |
Return true if the macro directive was loaded from a PCH file. More... | |
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. More... | |
const DefInfo | getDefinition () const |
bool | isDefined () const |
const MacroInfo * | getMacroInfo () const |
MacroInfo * | getMacroInfo () |
const DefInfo | findDirectiveAtLoc (SourceLocation L, SourceManager &SM) const |
Find macro definition active in the specified source location. If this macro was not defined there, return NULL. More... | |
void | dump () const |
Static Public Member Functions | |
static bool | classof (const MacroDirective *) |
Protected Member Functions | |
MacroDirective (Kind K, SourceLocation Loc) | |
Protected Attributes | |
MacroDirective * | Previous |
Previous macro directive for the same identifier, or NULL. More... | |
SourceLocation | Loc |
unsigned | MDKind: 2 |
MacroDirective kind. More... | |
bool | IsFromPCH: 1 |
True if the macro directive was loaded from a PCH file. More... | |
bool | IsPublic: 1 |
Whether the macro has public visibility (when described in a module). More... | |
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) but #pragma push_macro / pop_macro can create additional DefMacroDirectives for the same MacroInfo.
Definition at line 308 of file MacroInfo.h.
Enumerator | |
---|---|
MD_Define | |
MD_Undefine | |
MD_Visibility |
Definition at line 310 of file MacroInfo.h.
|
inlineprotected |
Definition at line 330 of file MacroInfo.h.
|
inlinestatic |
Definition at line 415 of file MacroInfo.h.
void MacroDirective::dump | ( | ) | const |
Definition at line 208 of file MacroInfo.cpp.
References getKind(), getPrevious(), IsFromPCH, IsPublic, MD_Define, MD_Undefine, and MD_Visibility.
const MacroDirective::DefInfo MacroDirective::findDirectiveAtLoc | ( | SourceLocation | L, |
SourceManager & | SM | ||
) | const |
Find macro definition active in the specified source location. If this macro was not defined there, return NULL.
Definition at line 196 of file MacroInfo.cpp.
References getDefinition(), clang::MacroDirective::DefInfo::getPreviousDefinition(), clang::SourceManager::isBeforeInTranslationUnit(), and clang::SourceLocation::isValid().
MacroDirective::DefInfo MacroDirective::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.
Definition at line 172 of file MacroInfo.cpp.
References getPrevious(), and clang::VisibilityMacroDirective::isPublic().
Referenced by findDirectiveAtLoc(), getDefinition(), getMacroInfo(), and isDefined().
|
inline |
Definition at line 394 of file MacroInfo.h.
References getDefinition().
|
inline |
Definition at line 335 of file MacroInfo.h.
References MDKind.
Referenced by clang::DefMacroDirective::classof(), clang::UndefMacroDirective::classof(), clang::VisibilityMacroDirective::classof(), and dump().
|
inline |
Definition at line 337 of file MacroInfo.h.
References Loc.
Referenced by clang::MacroDirective::DefInfo::getLocation(), and shouldIgnoreMacro().
|
inline |
Definition at line 404 of file MacroInfo.h.
References getDefinition(), and clang::MacroDirective::DefInfo::getMacroInfo().
Referenced by shouldIgnoreMacro().
|
inline |
Definition at line 407 of file MacroInfo.h.
References getDefinition(), and clang::MacroDirective::DefInfo::getMacroInfo().
|
inline |
Get previous definition of the macro with the same name.
Definition at line 343 of file MacroInfo.h.
References Previous.
Referenced by clang::Preprocessor::appendMacroDirective(), dump(), and getDefinition().
|
inline |
Get previous definition of the macro with the same name.
Definition at line 346 of file MacroInfo.h.
References Previous.
|
inline |
Definition at line 398 of file MacroInfo.h.
References getDefinition().
Referenced by clang::Preprocessor::appendMacroDirective(), and clang::Preprocessor::setLoadedMacroDirective().
|
inline |
Return true if the macro directive was loaded from a PCH file.
Definition at line 349 of file MacroInfo.h.
References IsFromPCH.
|
inline |
Definition at line 351 of file MacroInfo.h.
References IsFromPCH.
|
inline |
Set previous definition of the macro with the same name.
Definition at line 340 of file MacroInfo.h.
References Previous.
Referenced by clang::Preprocessor::appendMacroDirective(), and clang::ASTReader::resolvePendingMacro().
|
protected |
True if the macro directive was loaded from a PCH file.
Definition at line 322 of file MacroInfo.h.
Referenced by dump(), isFromPCH(), and setIsFromPCH().
|
protected |
Whether the macro has public visibility (when described in a module).
Definition at line 328 of file MacroInfo.h.
Referenced by dump(), clang::VisibilityMacroDirective::isPublic(), and clang::VisibilityMacroDirective::VisibilityMacroDirective().
|
protected |
Definition at line 316 of file MacroInfo.h.
Referenced by getLocation().
|
protected |
|
protected |
Previous macro directive for the same identifier, or NULL.
Definition at line 314 of file MacroInfo.h.
Referenced by getPrevious(), and setPrevious().