clang 24.0.0git
clang::ModuleMacro Class Reference

Represents a macro directive exported by a module. More...

#include "clang/Lex/MacroInfo.h"

Inheritance diagram for clang::ModuleMacro:
[legend]

Public Member Functions

std::pair< Module *, const IdentifierInfo * > getKey () const
const IdentifierInfo * getName () const
 Get the name of the macro.
Module * getOwningModule () const
 Get the ID of the module that exports this macro.
MacroInfo * getMacroInfo () const
 Get definition for this exported #define, or nullptr if this represents a #undef.
unsigned getNumOverridingMacros () const
 Get the number of macros that override this one.

Static Public Member Functions

static ModuleMacro * create (Preprocessor &PP, Module *OwningModule, const IdentifierInfo *II, MacroInfo *Macro, ArrayRef< ModuleMacro * > Overrides)

Friends

class Preprocessor
using overrides_iterator = ModuleMacro *const *
 Iterators over the overridden module IDs.
overrides_iterator overrides_begin () const
overrides_iterator overrides_end () const
ArrayRef< ModuleMacro * > overrides () const

Detailed Description

Represents a macro directive exported by a module.

There's an instance of this class for every macro #define or #undef that is the final directive for a macro name within a module. These entities also represent the macro override graph.

These are stored in a UniquingSet in the preprocessor.

Definition at line 515 of file MacroInfo.h.

Member Typedef Documentation

◆ overrides_iterator

Iterators over the overridden module IDs.

Definition at line 562 of file MacroInfo.h.

Member Function Documentation

◆ create()

ModuleMacro * ModuleMacro::create ( Preprocessor & PP,
Module * OwningModule,
const IdentifierInfo * II,
MacroInfo * Macro,
ArrayRef< ModuleMacro * > Overrides )
static

◆ getKey()

std::pair< Module *, const IdentifierInfo * > clang::ModuleMacro::getKey ( ) const
inline

Definition at line 546 of file MacroInfo.h.

◆ getMacroInfo()

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

Get definition for this exported #define, or nullptr if this represents a #undef.

Definition at line 558 of file MacroInfo.h.

◆ getName()

const IdentifierInfo * clang::ModuleMacro::getName ( ) const
inline

Get the name of the macro.

Definition at line 551 of file MacroInfo.h.

◆ getNumOverridingMacros()

unsigned clang::ModuleMacro::getNumOverridingMacros ( ) const
inline

Get the number of macros that override this one.

Definition at line 578 of file MacroInfo.h.

◆ getOwningModule()

Module * clang::ModuleMacro::getOwningModule ( ) const
inline

Get the ID of the module that exports this macro.

Definition at line 554 of file MacroInfo.h.

◆ overrides()

ArrayRef< ModuleMacro * > clang::ModuleMacro::overrides ( ) const
inline

Definition at line 572 of file MacroInfo.h.

References overrides_begin(), and overrides_end().

◆ overrides_begin()

overrides_iterator clang::ModuleMacro::overrides_begin ( ) const
inline

Definition at line 564 of file MacroInfo.h.

Referenced by overrides(), and overrides_end().

◆ overrides_end()

overrides_iterator clang::ModuleMacro::overrides_end ( ) const
inline

Definition at line 568 of file MacroInfo.h.

References overrides_begin().

Referenced by overrides().

◆ Preprocessor

friend class Preprocessor
friend

Definition at line 516 of file MacroInfo.h.

References Preprocessor.

Referenced by create(), and Preprocessor.


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