clang  14.0.0git
Public Member Functions | Static Public Member Functions | Friends | List of all members
clang::GlobalDecl Class Reference

GlobalDecl - represents a global declaration. More...

#include "clang/AST/GlobalDecl.h"

Public Member Functions

 GlobalDecl ()=default
 
 GlobalDecl (const VarDecl *D)
 
 GlobalDecl (const FunctionDecl *D, unsigned MVIndex=0)
 
 GlobalDecl (const FunctionDecl *D, KernelReferenceKind Kind)
 
 GlobalDecl (const NamedDecl *D)
 
 GlobalDecl (const BlockDecl *D)
 
 GlobalDecl (const CapturedDecl *D)
 
 GlobalDecl (const ObjCMethodDecl *D)
 
 GlobalDecl (const OMPDeclareReductionDecl *D)
 
 GlobalDecl (const OMPDeclareMapperDecl *D)
 
 GlobalDecl (const CXXConstructorDecl *D, CXXCtorType Type)
 
 GlobalDecl (const CXXDestructorDecl *D, CXXDtorType Type)
 
 GlobalDecl (const VarDecl *D, DynamicInitKind StubKind)
 
GlobalDecl getCanonicalDecl () const
 
const DeclgetDecl () const
 
CXXCtorType getCtorType () const
 
CXXDtorType getDtorType () const
 
DynamicInitKind getDynamicInitKind () const
 
unsigned getMultiVersionIndex () const
 
KernelReferenceKind getKernelReferenceKind () const
 
void * getAsOpaquePtr () const
 
 operator bool () const
 
GlobalDecl getWithDecl (const Decl *D)
 
GlobalDecl getWithCtorType (CXXCtorType Type)
 
GlobalDecl getWithDtorType (CXXDtorType Type)
 
GlobalDecl getWithMultiVersionIndex (unsigned Index)
 
GlobalDecl getWithKernelReferenceKind (KernelReferenceKind Kind)
 

Static Public Member Functions

static GlobalDecl getFromOpaquePtr (void *P)
 
static KernelReferenceKind getDefaultKernelReference (const FunctionDecl *D)
 

Friends

bool operator== (const GlobalDecl &LHS, const GlobalDecl &RHS)
 

Detailed Description

GlobalDecl - represents a global declaration.

This can either be a CXXConstructorDecl and the constructor type (Base, Complete). a CXXDestructorDecl and the destructor type (Base, Complete), a FunctionDecl and the kernel reference type (Kernel, Stub), or a VarDecl, a FunctionDecl or a BlockDecl.

When a new type of GlobalDecl is added, the following places should be updated to convert a Decl* to a GlobalDecl: PredefinedExpr::ComputeName() in lib/AST/Expr.cpp. getParentOfLocalEntity() in lib/AST/ItaniumMangle.cpp ASTNameGenerator::Implementation::writeFuncOrVarName in lib/AST/Mangle.cpp

Definition at line 55 of file GlobalDecl.h.

Constructor & Destructor Documentation

◆ GlobalDecl() [1/13]

clang::GlobalDecl::GlobalDecl ( )
default

◆ GlobalDecl() [2/13]

clang::GlobalDecl::GlobalDecl ( const VarDecl D)
inline

Definition at line 69 of file GlobalDecl.h.

◆ GlobalDecl() [3/13]

clang::GlobalDecl::GlobalDecl ( const FunctionDecl D,
unsigned  MVIndex = 0 
)
inline

Definition at line 70 of file GlobalDecl.h.

References getDefaultKernelReference(), and clang::Decl::hasAttr().

◆ GlobalDecl() [4/13]

clang::GlobalDecl::GlobalDecl ( const FunctionDecl D,
KernelReferenceKind  Kind 
)
inline

Definition at line 78 of file GlobalDecl.h.

References clang::Decl::hasAttr().

◆ GlobalDecl() [5/13]

clang::GlobalDecl::GlobalDecl ( const NamedDecl D)
inline

Definition at line 82 of file GlobalDecl.h.

◆ GlobalDecl() [6/13]

clang::GlobalDecl::GlobalDecl ( const BlockDecl D)
inline

Definition at line 83 of file GlobalDecl.h.

◆ GlobalDecl() [7/13]

clang::GlobalDecl::GlobalDecl ( const CapturedDecl D)
inline

Definition at line 84 of file GlobalDecl.h.

◆ GlobalDecl() [8/13]

clang::GlobalDecl::GlobalDecl ( const ObjCMethodDecl D)
inline

Definition at line 85 of file GlobalDecl.h.

◆ GlobalDecl() [9/13]

clang::GlobalDecl::GlobalDecl ( const OMPDeclareReductionDecl D)
inline

Definition at line 86 of file GlobalDecl.h.

◆ GlobalDecl() [10/13]

clang::GlobalDecl::GlobalDecl ( const OMPDeclareMapperDecl D)
inline

Definition at line 87 of file GlobalDecl.h.

◆ GlobalDecl() [11/13]

clang::GlobalDecl::GlobalDecl ( const CXXConstructorDecl D,
CXXCtorType  Type 
)
inline

Definition at line 88 of file GlobalDecl.h.

◆ GlobalDecl() [12/13]

clang::GlobalDecl::GlobalDecl ( const CXXDestructorDecl D,
CXXDtorType  Type 
)
inline

Definition at line 89 of file GlobalDecl.h.

◆ GlobalDecl() [13/13]

clang::GlobalDecl::GlobalDecl ( const VarDecl D,
DynamicInitKind  StubKind 
)
inline

Definition at line 90 of file GlobalDecl.h.

Member Function Documentation

◆ getAsOpaquePtr()

void* clang::GlobalDecl::getAsOpaquePtr ( ) const
inline

◆ getCanonicalDecl()

GlobalDecl clang::GlobalDecl::getCanonicalDecl ( ) const
inline

◆ getCtorType()

CXXCtorType clang::GlobalDecl::getCtorType ( ) const
inline

◆ getDecl()

const Decl* clang::GlobalDecl::getDecl ( ) const
inline

Definition at line 102 of file GlobalDecl.h.

Referenced by clang::CodeGen::CodeGenTypes::arrangeCXXStructorDeclaration(), clang::CodeGen::CodeGenTypes::arrangeGlobalDeclaration(), clang::CodeGen::CodeGenPGO::assignRegionCounters(), asTemplateName(), clang::CodeGen::CodeGenFunction::BuildFunctionArgList(), clang::CodeGen::CGCXXABI::buildThisParam(), clang::CodeGen::CodeGenModule::codegenCXXStructor(), clang::CodeGen::CodeGenFunction::EmitAsanPrologueOrEpilogue(), clang::CodeGen::CodeGenFunction::EmitBuiltinExpr(), clang::CodeGen::CodeGenFunction::EmitCall(), clang::CodeGen::CodeGenFunction::EmitCallAndReturnForThunk(), clang::CodeGen::CodeGenFunction::EmitConstructorBody(), clang::CodeGen::CodeGenFunction::EmitCXXDestructorCall(), clang::CodeGen::CodeGenFunction::EmitDestructorBody(), EmitDirectCallee(), EmitFunctionDeclLValue(), EmitFunctionDeclPointer(), clang::CodeGen::CodeGenModule::EmitGlobal(), EmitGlobalDeclMetadata(), clang::CodeGen::CodeGenFunction::emitImplicitAssignmentOperatorBody(), clang::CodeGen::CGOpenMPRuntime::emitTargetFunctions(), clang::CodeGen::CGOpenMPRuntime::emitTargetGlobal(), clang::CodeGen::CGOpenMPRuntime::emitTargetGlobalVariable(), clang::CodeGen::CodeGenVTables::EmitThunks(), clang::CodeGen::CodeGenFunction::GenerateCode(), clang::CodeGen::CodeGenFunction::GenerateVarArgsThunk(), clang::CodeGen::CodeGenModule::getAddrAndTypeOfCXXStructor(), clang::CodeGen::CodeGenModule::GetAddrOfFunction(), clang::CodeGen::CodeGenModule::GetAddrOfGlobal(), clang::CodeGen::CodeGenModule::getBlockMangledName(), getCtorType(), getDtorType(), getDynamicInitKind(), clang::ASTContext::getFunctionFeatureMap(), clang::CodeGen::CodeGenModule::getFunctionLinkage(), clang::CodeGen::CodeGenTypes::GetFunctionTypeForVTable(), getKernelReferenceKind(), clang::CodeGen::CodeGenModule::getMangledName(), clang::MicrosoftVTableContext::getMethodVFTableLocation(), clang::ItaniumVTableContext::getMethodVTableIndex(), getMultiVersionIndex(), getMultiversionLinkage(), clang::VTableContextBase::getThunkInfo(), clang::MicrosoftVTableContext::getThunkInfo(), clang::CodeGen::CodeGenFunction::GetVTTParameter(), getWithCtorType(), getWithDtorType(), getWithKernelReferenceKind(), clang::CodeGen::CodeGenFunction::InlinedInheritingConstructorScope::InlinedInheritingConstructorScope(), isDeletingDtor(), isTemplate(), isUniqueInternalLinkageDecl(), clang::MangleContext::mangleName(), clang::CodeGen::CGOpenMPRuntime::markAsGlobalTarget(), clang::CodeGen::CodeGenModule::SetCommonAttributes(), clang::CodeGen::CodeGenModule::setDLLImportDLLExport(), clang::CodeGen::CodeGenModule::setGVProperties(), clang::CodeGen::CodeGenModule::SetInternalFunctionAttributes(), clang::CodeGen::CodeGenFunction::StartFunction(), and clang::CodeGen::CodeGenFunction::StartThunk().

◆ getDefaultKernelReference()

static KernelReferenceKind clang::GlobalDecl::getDefaultKernelReference ( const FunctionDecl D)
inlinestatic

Definition at line 153 of file GlobalDecl.h.

References clang::Decl::getLangOpts(), clang::Kernel, and clang::Stub.

Referenced by GlobalDecl().

◆ getDtorType()

CXXDtorType clang::GlobalDecl::getDtorType ( ) const
inline

◆ getDynamicInitKind()

DynamicInitKind clang::GlobalDecl::getDynamicInitKind ( ) const
inline

Definition at line 114 of file GlobalDecl.h.

References getDecl().

◆ getFromOpaquePtr()

static GlobalDecl clang::GlobalDecl::getFromOpaquePtr ( void *  P)
inlinestatic

Definition at line 147 of file GlobalDecl.h.

References P.

Referenced by llvm::DenseMapInfo< clang::GlobalDecl >::getTombstoneKey().

◆ getKernelReferenceKind()

KernelReferenceKind clang::GlobalDecl::getKernelReferenceKind ( ) const
inline

Definition at line 131 of file GlobalDecl.h.

References getDecl().

Referenced by getMangledNameImpl().

◆ getMultiVersionIndex()

unsigned clang::GlobalDecl::getMultiVersionIndex ( ) const
inline

Definition at line 121 of file GlobalDecl.h.

References getDecl().

Referenced by clang::ASTContext::getFunctionFeatureMap(), and getMangledNameImpl().

◆ getWithCtorType()

GlobalDecl clang::GlobalDecl::getWithCtorType ( CXXCtorType  Type)
inline

Definition at line 164 of file GlobalDecl.h.

References getDecl().

◆ getWithDecl()

GlobalDecl clang::GlobalDecl::getWithDecl ( const Decl D)
inline

Definition at line 158 of file GlobalDecl.h.

Referenced by getMangledNameImpl(), and isTemplate().

◆ getWithDtorType()

GlobalDecl clang::GlobalDecl::getWithDtorType ( CXXDtorType  Type)
inline

Definition at line 171 of file GlobalDecl.h.

References getDecl().

Referenced by clang::CodeGen::CodeGenModule::getAddrAndTypeOfCXXStructor().

◆ getWithKernelReferenceKind()

GlobalDecl clang::GlobalDecl::getWithKernelReferenceKind ( KernelReferenceKind  Kind)
inline

Definition at line 189 of file GlobalDecl.h.

References getDecl().

Referenced by clang::CodeGen::CodeGenModule::getMangledName().

◆ getWithMultiVersionIndex()

GlobalDecl clang::GlobalDecl::getWithMultiVersionIndex ( unsigned  Index)
inline

Definition at line 178 of file GlobalDecl.h.

◆ operator bool()

clang::GlobalDecl::operator bool ( ) const
inlineexplicit

Definition at line 145 of file GlobalDecl.h.

References getAsOpaquePtr().

Friends And Related Function Documentation

◆ operator==

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

Definition at line 138 of file GlobalDecl.h.


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