clang 8.0.0

Public Member Functions | List of all members
clang::MacroDefinition Class Reference

A description of the current definition of a macro. More...

`#include "clang/Lex/MacroInfo.h"`

## Public Member Functions
| MacroDefinition ()=default
| MacroDefinition (DefMacroDirective *MD, ArrayRef< ModuleMacro *> MMs, bool IsAmbiguous)
| operator bool () const
| Determine whether there is a definition of this macro. More...
MacroInfo * | getMacroInfo () const
| Get the MacroInfo that should be used for this definition. More...
bool | isAmbiguous () const
| `true` if the definition is ambiguous, `false` otherwise. More...
DefMacroDirective * | getLocalDirective () const
| Get the latest non-imported, non-#undef'd macro definition for this macro. More...
ArrayRef< ModuleMacro * > | getModuleMacros () const
| Get the active module macros for this macro. More...
template<typename Fn >
void | forAllDefinitions (Fn F) const

## Detailed Description

A description of the current definition of a macro.

The definition of a macro comprises a set of (at least one) defining entities, which are either local MacroDirectives or imported ModuleMacros.

Definition at line 565 of file MacroInfo.h.

## Constructor & Destructor Documentation

## ◆ MacroDefinition() [1/2]

clang::MacroDefinition::MacroDefinition | ( |  | ) |
| default

## ◆ MacroDefinition() [2/2]

clang::MacroDefinition::MacroDefinition | ( | DefMacroDirective * | MD,
|  | ArrayRef< ModuleMacro *> | MMs,
|  | bool | IsAmbiguous
| ) |  |
| inline

Definition at line 571 of file MacroInfo.h.

## Member Function Documentation

## ◆ forAllDefinitions()

template<typename Fn >

void clang::MacroDefinition::forAllDefinitions | ( | Fn | F | ) | const
| inline

Definition at line 601 of file MacroInfo.h.

Referenced by clang::PreprocessingRecord::findMacroDefinition(), and isTrivialSingleTokenExpansion().

## ◆ getLocalDirective()

DefMacroDirective* clang::MacroDefinition::getLocalDirective | ( |  | ) | const
| inline

Get the latest non-imported, non-#undef'd macro definition for this macro.

Definition at line 594 of file MacroInfo.h.

## ◆ getMacroInfo()

MacroInfo* clang::MacroDefinition::getMacroInfo | ( |  | ) | const
| inline

Get the MacroInfo that should be used for this definition.

Definition at line 581 of file MacroInfo.h.

Referenced by DoPrintMacros(), EvaluateDefined(), clang::PreprocessingRecord::findMacroDefinition(), and isTrivialSingleTokenExpansion().

## ◆ getModuleMacros()

ArrayRef<ModuleMacro *> clang::MacroDefinition::getModuleMacros | ( |  | ) | const
| inline

Get the active module macros for this macro.

Definition at line 599 of file MacroInfo.h.

## ◆ isAmbiguous()

bool clang::MacroDefinition::isAmbiguous | ( |  | ) | const
| inline

`true` if the definition is ambiguous, `false` otherwise.

Definition at line 590 of file MacroInfo.h.

Referenced by isTrivialSingleTokenExpansion().

## ◆ operator bool()

clang::MacroDefinition::operator bool | ( |  | ) | const
| inline explicit

Determine whether there is a definition of this macro.

Definition at line 576 of file MacroInfo.h.

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

- include/clang/Lex/MacroInfo.h