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 102 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 113 of file DeclID.h.

Constructor & Destructor Documentation

◆ DeclIDBase() [1/2]

clang::DeclIDBase::DeclIDBase ( )
inlineprotected

Definition at line 116 of file DeclID.h.

◆ DeclIDBase() [2/2]

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

Definition at line 117 of file DeclID.h.

Member Function Documentation

◆ getLocalDeclIndex()

unsigned DeclIDBase::getLocalDeclIndex ( ) const

◆ getModuleFileIndex()

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

Definition at line 130 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 122 of file DeclID.h.

References ID.

◆ operator PredefinedDeclIDs()

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

Definition at line 124 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 138 of file DeclID.h.

◆ operator!= [2/2]

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

Definition at line 157 of file DeclID.h.

◆ operator< [1/2]

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

Definition at line 141 of file DeclID.h.

◆ operator< [2/2]

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

Definition at line 162 of file DeclID.h.

◆ operator<= [1/2]

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

Definition at line 144 of file DeclID.h.

◆ operator<= [2/2]

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

Definition at line 168 of file DeclID.h.

◆ operator== [1/2]

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

Definition at line 135 of file DeclID.h.

◆ operator== [2/2]

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

Definition at line 154 of file DeclID.h.

◆ operator> [1/2]

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

Definition at line 147 of file DeclID.h.

◆ operator> [2/2]

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

Definition at line 165 of file DeclID.h.

◆ operator>= [1/2]

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

Definition at line 150 of file DeclID.h.

◆ operator>= [2/2]

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

Definition at line 171 of file DeclID.h.

Member Data Documentation

◆ ID

DeclID clang::DeclIDBase::ID
protected

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