clang 22.0.0git
clang::DeclIDBase Class Reference

GlobalDeclID means DeclID in the current ASTContext and LocalDeclID means DeclID specific to a certain ModuleFile. More...

#include "clang/AST/DeclID.h"

Inheritance diagram for clang::DeclIDBase:
[legend]

Public Types

using DeclID = uint64_t
 An ID number that refers to a declaration in an AST file.

Public Member Functions

DeclID getRawValue () const
 operator DeclID () const
 operator PredefinedDeclIDs () const
bool isValid () const
bool isInvalid () const
unsigned getModuleFileIndex () const
unsigned getLocalDeclIndex () const

Protected Member Functions

 DeclIDBase ()
 DeclIDBase (DeclID ID)

Protected Attributes

DeclID ID

Friends

bool operator== (const DeclIDBase &LHS, const DeclID &RHS)
bool operator!= (const DeclIDBase &LHS, const DeclID &RHS)
bool operator< (const DeclIDBase &LHS, const DeclID &RHS)
bool operator<= (const DeclIDBase &LHS, const DeclID &RHS)
bool operator> (const DeclIDBase &LHS, const DeclID &RHS)
bool operator>= (const DeclIDBase &LHS, const DeclID &RHS)
bool operator== (const DeclIDBase &LHS, const DeclIDBase &RHS)
bool operator!= (const DeclIDBase &LHS, const DeclIDBase &RHS)
bool operator< (const DeclIDBase &LHS, const DeclIDBase &RHS)
bool operator> (const DeclIDBase &LHS, const DeclIDBase &RHS)
bool operator<= (const DeclIDBase &LHS, const DeclIDBase &RHS)
bool operator>= (const DeclIDBase &LHS, const DeclIDBase &RHS)

Detailed Description

GlobalDeclID means DeclID in the current ASTContext and LocalDeclID means DeclID specific to a certain ModuleFile.

Specially, in ASTWriter, the LocalDeclID to the ModuleFile been writting is equal to the GlobalDeclID. Outside the serializer, all the DeclID been used should be GlobalDeclID. We can translate a LocalDeclID to the GlobalDeclID by ASTReader::getGlobalDeclID().

Definition at line 97 of file DeclID.h.

Member Typedef Documentation

◆ DeclID

using clang::DeclIDBase::DeclID = uint64_t

An ID number that refers to a declaration in an AST file.

The ID numbers of declarations are consecutive (in order of discovery), with values below NUM_PREDEF_DECL_IDS being reserved. At the start of a chain of precompiled headers, declaration ID 1 is used for the translation unit declaration.

DeclID should only be used directly in serialization. All other users should use LocalDeclID or GlobalDeclID.

Definition at line 108 of file DeclID.h.

Constructor & Destructor Documentation

◆ DeclIDBase() [1/2]

clang::DeclIDBase::DeclIDBase ( )
inlineprotected

◆ DeclIDBase() [2/2]

clang::DeclIDBase::DeclIDBase ( DeclID ID)
inlineexplicitprotected

Definition at line 112 of file DeclID.h.

References ID.

Member Function Documentation

◆ getLocalDeclIndex()

unsigned DeclIDBase::getLocalDeclIndex ( ) const

◆ getModuleFileIndex()

unsigned clang::DeclIDBase::getModuleFileIndex ( ) const
inline

Definition at line 125 of file DeclID.h.

References ID.

Referenced by clang::ASTReader::getGlobalDeclID().

◆ getRawValue()

◆ isInvalid()

bool clang::DeclIDBase::isInvalid ( ) const
inline

◆ isValid()

bool clang::DeclIDBase::isValid ( ) const
inline

◆ operator DeclID()

clang::DeclIDBase::operator DeclID ( ) const
inlineexplicit

Definition at line 117 of file DeclID.h.

References ID.

◆ operator PredefinedDeclIDs()

clang::DeclIDBase::operator PredefinedDeclIDs ( ) const
inlineexplicit

Definition at line 119 of file DeclID.h.

References ID.

◆ operator!= [1/2]

bool operator!= ( const DeclIDBase & LHS,
const DeclID & RHS )
friend

Definition at line 133 of file DeclID.h.

References DeclIDBase(), and operator==.

◆ operator!= [2/2]

bool operator!= ( const DeclIDBase & LHS,
const DeclIDBase & RHS )
friend

Definition at line 152 of file DeclID.h.

References DeclIDBase(), and ID.

◆ operator< [1/2]

bool operator< ( const DeclIDBase & LHS,
const DeclID & RHS )
friend

Definition at line 136 of file DeclID.h.

References DeclIDBase(), and ID.

◆ operator< [2/2]

bool operator< ( const DeclIDBase & LHS,
const DeclIDBase & RHS )
friend

Definition at line 157 of file DeclID.h.

References DeclIDBase(), and ID.

◆ operator<= [1/2]

bool operator<= ( const DeclIDBase & LHS,
const DeclID & RHS )
friend

Definition at line 139 of file DeclID.h.

References DeclIDBase(), and ID.

◆ operator<= [2/2]

bool operator<= ( const DeclIDBase & LHS,
const DeclIDBase & RHS )
friend

Definition at line 163 of file DeclID.h.

References DeclIDBase(), and ID.

◆ operator== [1/2]

bool operator== ( const DeclIDBase & LHS,
const DeclID & RHS )
friend

Definition at line 130 of file DeclID.h.

References DeclIDBase(), and ID.

Referenced by operator!=.

◆ operator== [2/2]

bool operator== ( const DeclIDBase & LHS,
const DeclIDBase & RHS )
friend

Definition at line 149 of file DeclID.h.

References DeclIDBase(), and ID.

◆ operator> [1/2]

bool operator> ( const DeclIDBase & LHS,
const DeclID & RHS )
friend

Definition at line 142 of file DeclID.h.

References DeclIDBase(), and ID.

◆ operator> [2/2]

bool operator> ( const DeclIDBase & LHS,
const DeclIDBase & RHS )
friend

Definition at line 160 of file DeclID.h.

References DeclIDBase(), and ID.

◆ operator>= [1/2]

bool operator>= ( const DeclIDBase & LHS,
const DeclID & RHS )
friend

Definition at line 145 of file DeclID.h.

References DeclIDBase(), and ID.

◆ operator>= [2/2]

bool operator>= ( const DeclIDBase & LHS,
const DeclIDBase & RHS )
friend

Definition at line 166 of file DeclID.h.

References DeclIDBase(), and ID.

Member Data Documentation

◆ ID


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