clang 19.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 = uint32_t
 An ID number that refers to a declaration in an AST file.
 

Public Member Functions

DeclID get () const
 
 operator DeclID () const
 
 operator PredefinedDeclIDs () const
 
bool isValid () const
 
bool isInvalid () const
 

Protected Member Functions

 DeclIDBase ()
 
 DeclIDBase (DeclID ID)
 

Protected Attributes

DeclID ID
 

Friends

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

Member Typedef Documentation

◆ DeclID

using clang::DeclIDBase::DeclID = uint32_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 110 of file DeclID.h.

Constructor & Destructor Documentation

◆ DeclIDBase() [1/2]

clang::DeclIDBase::DeclIDBase ( )
inlineprotected

Definition at line 113 of file DeclID.h.

◆ DeclIDBase() [2/2]

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

Definition at line 114 of file DeclID.h.

Member Function Documentation

◆ get()

DeclID clang::DeclIDBase::get ( ) 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 119 of file DeclID.h.

References ID.

◆ operator PredefinedDeclIDs()

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

Definition at line 121 of file DeclID.h.

References ID.

Friends And Related Function Documentation

◆ operator!=

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

Definition at line 130 of file DeclID.h.

◆ operator<

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

Definition at line 134 of file DeclID.h.

◆ operator<=

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

Definition at line 140 of file DeclID.h.

◆ operator==

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

Definition at line 127 of file DeclID.h.

◆ operator>

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

Definition at line 137 of file DeclID.h.

◆ operator>=

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

Definition at line 143 of file DeclID.h.

Member Data Documentation

◆ ID

DeclID clang::DeclIDBase::ID
protected

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