clang 20.0.0git
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
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:
Inheritance graph
[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 100 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 111 of file DeclID.h.

Constructor & Destructor Documentation

◆ DeclIDBase() [1/2]

clang::DeclIDBase::DeclIDBase ( )
inlineprotected

Definition at line 114 of file DeclID.h.

◆ DeclIDBase() [2/2]

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

Definition at line 115 of file DeclID.h.

Member Function Documentation

◆ getLocalDeclIndex()

unsigned DeclIDBase::getLocalDeclIndex ( ) const

◆ getModuleFileIndex()

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

Definition at line 128 of file DeclID.h.

References ID.

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

◆ getRawValue()

DeclID clang::DeclIDBase::getRawValue ( ) const
inline

◆ 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 120 of file DeclID.h.

References ID.

◆ operator PredefinedDeclIDs()

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

Definition at line 122 of file DeclID.h.

References ID.

Friends And Related Function Documentation

◆ operator!= [1/2]

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

Definition at line 136 of file DeclID.h.

◆ operator!= [2/2]

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

Definition at line 155 of file DeclID.h.

◆ operator< [1/2]

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

Definition at line 139 of file DeclID.h.

◆ operator< [2/2]

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

Definition at line 160 of file DeclID.h.

◆ operator<= [1/2]

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

Definition at line 142 of file DeclID.h.

◆ operator<= [2/2]

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

Definition at line 166 of file DeclID.h.

◆ operator== [1/2]

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

Definition at line 133 of file DeclID.h.

◆ operator== [2/2]

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

Definition at line 152 of file DeclID.h.

◆ operator> [1/2]

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

Definition at line 145 of file DeclID.h.

◆ operator> [2/2]

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

Definition at line 163 of file DeclID.h.

◆ operator>= [1/2]

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

Definition at line 148 of file DeclID.h.

◆ operator>= [2/2]

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

Definition at line 169 of file DeclID.h.

Member Data Documentation

◆ ID

DeclID clang::DeclIDBase::ID
protected

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