clang 20.0.0git
|
MangleContext - Context for tracking state which persists across multiple calls to the C++ name mangler. More...
#include "clang/AST/Mangle.h"
Public Types | |
enum | ManglerKind { MK_Itanium , MK_Microsoft } |
Public Member Functions | |
ManglerKind | getKind () const |
bool | isAux () const |
MangleContext (ASTContext &Context, DiagnosticsEngine &Diags, ManglerKind Kind, bool IsAux=false) | |
virtual | ~MangleContext () |
ASTContext & | getASTContext () const |
DiagnosticsEngine & | getDiags () const |
virtual void | startNewFunction () |
unsigned | getBlockId (const BlockDecl *BD, bool Local) |
uint64_t | getAnonymousStructId (const NamedDecl *D, const FunctionDecl *FD=nullptr) |
uint64_t | getAnonymousStructIdForDebugInfo (const NamedDecl *D) |
virtual std::string | getLambdaString (const CXXRecordDecl *Lambda)=0 |
Mangler Entry Points | |
bool | shouldMangleDeclName (const NamedDecl *D) |
virtual bool | shouldMangleCXXName (const NamedDecl *D)=0 |
virtual bool | shouldMangleStringLiteral (const StringLiteral *SL)=0 |
virtual bool | isUniqueInternalLinkageDecl (const NamedDecl *ND) |
virtual void | needsUniqueInternalLinkageNames () |
void | mangleName (GlobalDecl GD, raw_ostream &) |
virtual void | mangleCXXName (GlobalDecl GD, raw_ostream &)=0 |
virtual void | mangleThunk (const CXXMethodDecl *MD, const ThunkInfo &Thunk, bool ElideOverrideInfo, raw_ostream &)=0 |
virtual void | mangleCXXDtorThunk (const CXXDestructorDecl *DD, CXXDtorType Type, const ThunkInfo &Thunk, bool ElideOverrideInfo, raw_ostream &)=0 |
virtual void | mangleReferenceTemporary (const VarDecl *D, unsigned ManglingNumber, raw_ostream &)=0 |
virtual void | mangleCXXVTable (const CXXRecordDecl *RD, raw_ostream &)=0 |
virtual void | mangleCXXRTTI (QualType T, raw_ostream &)=0 |
virtual void | mangleCXXRTTIName (QualType T, raw_ostream &, bool NormalizeIntegers=false)=0 |
virtual void | mangleStringLiteral (const StringLiteral *SL, raw_ostream &)=0 |
virtual void | mangleMSGuidDecl (const MSGuidDecl *GD, raw_ostream &) |
void | mangleGlobalBlock (const BlockDecl *BD, const NamedDecl *ID, raw_ostream &Out) |
void | mangleCtorBlock (const CXXConstructorDecl *CD, CXXCtorType CT, const BlockDecl *BD, raw_ostream &Out) |
void | mangleDtorBlock (const CXXDestructorDecl *CD, CXXDtorType DT, const BlockDecl *BD, raw_ostream &Out) |
void | mangleBlock (const DeclContext *DC, const BlockDecl *BD, raw_ostream &Out) |
void | mangleObjCMethodName (const ObjCMethodDecl *MD, raw_ostream &OS, bool includePrefixByte=true, bool includeCategoryNamespace=true) |
void | mangleObjCMethodNameAsSourceName (const ObjCMethodDecl *MD, raw_ostream &) |
virtual void | mangleStaticGuardVariable (const VarDecl *D, raw_ostream &)=0 |
virtual void | mangleDynamicInitializer (const VarDecl *D, raw_ostream &)=0 |
virtual void | mangleDynamicAtExitDestructor (const VarDecl *D, raw_ostream &)=0 |
virtual void | mangleSEHFilterExpression (GlobalDecl EnclosingDecl, raw_ostream &Out)=0 |
virtual void | mangleSEHFinallyBlock (GlobalDecl EnclosingDecl, raw_ostream &Out)=0 |
virtual void | mangleCanonicalTypeName (QualType T, raw_ostream &, bool NormalizeIntegers=false)=0 |
Generates a unique string for an externally visible type for use with TBAA or type uniquing. | |
MangleContext - Context for tracking state which persists across multiple calls to the C++ name mangler.
|
inlineexplicit |
|
inlinevirtual |
|
inline |
Definition at line 92 of file Mangle.h.
References D, Id, and clang::Result.
|
inline |
Definition at line 106 of file Mangle.h.
References D, and clang::Result.
|
inline |
Definition at line 78 of file Mangle.h.
Referenced by mangleName(), mangleObjCMethodName(), and shouldMangleDeclName().
Definition at line 84 of file Mangle.h.
References clang::Result.
Referenced by mangleBlock(), and mangleGlobalBlock().
|
inline |
|
inline |
Definition at line 68 of file Mangle.h.
Referenced by clang::CodeGen::CodeGenModule::CodeGenModule().
|
pure virtual |
|
inlinevirtual |
Definition at line 124 of file Mangle.h.
Referenced by shouldMangleDeclName().
void MangleContext::mangleBlock | ( | const DeclContext * | DC, |
const BlockDecl * | BD, | ||
raw_ostream & | Out | ||
) |
Definition at line 292 of file Mangle.cpp.
References clang::Ctor_Complete, clang::Dtor_Complete, getBlockId(), clang::DeclContext::getParent(), mangleCtorBlock(), mangleDtorBlock(), mangleFunctionBlock(), mangleName(), mangleObjCMethodNameAsSourceName(), and shouldMangleDeclName().
Referenced by clang::CodeGen::CodeGenModule::getBlockMangledName().
|
pure virtual |
Generates a unique string for an externally visible type for use with TBAA or type uniquing.
TODO: Extend this to internal types by generating names that are unique across translation units so it can be used with LTO.
Referenced by clang::CodeGen::CodeGenModule::CreateKCFITypeId(), clang::CodeGen::CGOpenMPRuntime::emitUserDefinedMapper(), clang::CodeGen::CodeGenModule::EmitVTableTypeMetadata(), and getBlockCaptureStr().
void MangleContext::mangleCtorBlock | ( | const CXXConstructorDecl * | CD, |
CXXCtorType | CT, | ||
const BlockDecl * | BD, | ||
raw_ostream & | Out | ||
) |
Definition at line 274 of file Mangle.cpp.
References mangleFunctionBlock(), and mangleName().
Referenced by clang::CodeGen::CodeGenModule::getBlockMangledName(), and mangleBlock().
|
pure virtual |
|
pure virtual |
Referenced by mangleName().
|
pure virtual |
|
pure virtual |
Referenced by getTypeIdentifier().
|
pure virtual |
void MangleContext::mangleDtorBlock | ( | const CXXDestructorDecl * | CD, |
CXXDtorType | DT, | ||
const BlockDecl * | BD, | ||
raw_ostream & | Out | ||
) |
Definition at line 283 of file Mangle.cpp.
References mangleFunctionBlock(), and mangleName().
Referenced by clang::CodeGen::CodeGenModule::getBlockMangledName(), and mangleBlock().
|
pure virtual |
|
pure virtual |
void MangleContext::mangleGlobalBlock | ( | const BlockDecl * | BD, |
const NamedDecl * | ID, | ||
raw_ostream & | Out | ||
) |
Definition at line 257 of file Mangle.cpp.
References getBlockId(), mangleName(), and shouldMangleDeclName().
Referenced by clang::CodeGen::CodeGenModule::getBlockMangledName().
|
virtual |
Definition at line 243 of file Mangle.cpp.
References clang::C, clang::MSGuidDecl::getParts(), and P.
Referenced by mangleName().
void MangleContext::mangleName | ( | GlobalDecl | GD, |
raw_ostream & | Out | ||
) |
Definition at line 138 of file Mangle.cpp.
References clang::Type::castAs(), CCM_Fast, CCM_Other, CCM_RegCall, CCM_Std, CCM_Vector, CCM_WasmMainArgcArgv, D, clang::Default, getASTContext(), clang::Decl::getAttr(), getCallingConvMangling(), clang::TargetInfo::getCXXABI(), clang::GlobalDecl::getDecl(), clang::TargetInfo::getPointerWidth(), clang::ASTContext::getTargetInfo(), clang::ValueDecl::getType(), clang::ASTContext::getTypeSize(), clang::TargetInfo::getUserLabelPrefix(), mangleCXXName(), mangleMSGuidDecl(), mangleObjCMethodNameAsSourceName(), and shouldMangleCXXName().
Referenced by getMangledNameImpl(), mangleBlock(), mangleCtorBlock(), mangleDtorBlock(), and mangleGlobalBlock().
void MangleContext::mangleObjCMethodName | ( | const ObjCMethodDecl * | MD, |
raw_ostream & | OS, | ||
bool | includePrefixByte = true , |
||
bool | includeCategoryNamespace = true |
||
) |
Definition at line 327 of file Mangle.cpp.
References getASTContext(), clang::ObjCMethodDecl::getCategory(), clang::ObjCMethodDecl::getClassInterface(), clang::Decl::getDeclContext(), clang::NamedDecl::getName(), clang::ObjCMethodDecl::getSelector(), clang::ObjCMethodDecl::isClassMethod(), clang::ObjCRuntime::isGNUFamily(), clang::ObjCMethodDecl::isInstanceMethod(), and clang::Selector::print().
Referenced by clang::CodeGen::CGObjCRuntime::getSymbolNameForMethod(), and mangleObjCMethodNameAsSourceName().
void MangleContext::mangleObjCMethodNameAsSourceName | ( | const ObjCMethodDecl * | MD, |
raw_ostream & | Out | ||
) |
Definition at line 384 of file Mangle.cpp.
References mangleObjCMethodName().
Referenced by mangleBlock(), and mangleName().
|
pure virtual |
Referenced by clang::CodeGen::CodeGenModule::GetAddrOfGlobalTemporary().
|
pure virtual |
|
pure virtual |
|
pure virtual |
|
pure virtual |
|
pure virtual |
|
inlinevirtual |
Definition at line 128 of file Mangle.h.
Referenced by getMangledNameImpl().
Referenced by mangleName(), and shouldMangleDeclName().
Definition at line 104 of file Mangle.cpp.
References CCM_Other, clang::CPlusPlus, D, getASTContext(), getCallingConvMangling(), clang::Decl::getOwningModuleForLinkage(), clang::Decl::hasAttr(), clang::Decl::hasAttrs(), isUniqueInternalLinkageDecl(), and shouldMangleCXXName().
Referenced by getMangledNameImpl(), mangleBlock(), and mangleGlobalBlock().
|
pure virtual |
|
inlinevirtual |