clang 20.0.0git
Public Types | Public Member Functions | List of all members
clang::MangleContext Class Referenceabstract

MangleContext - Context for tracking state which persists across multiple calls to the C++ name mangler. More...

#include "clang/AST/Mangle.h"

Inheritance diagram for clang::MangleContext:
Inheritance graph
[legend]

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 ()
 
ASTContextgetASTContext () const
 
DiagnosticsEnginegetDiags () 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.
 

Detailed Description

MangleContext - Context for tracking state which persists across multiple calls to the C++ name mangler.

Definition at line 45 of file Mangle.h.

Member Enumeration Documentation

◆ ManglerKind

Enumerator
MK_Itanium 
MK_Microsoft 

Definition at line 47 of file Mangle.h.

Constructor & Destructor Documentation

◆ MangleContext()

clang::MangleContext::MangleContext ( ASTContext Context,
DiagnosticsEngine Diags,
ManglerKind  Kind,
bool  IsAux = false 
)
inlineexplicit

Definition at line 72 of file Mangle.h.

◆ ~MangleContext()

virtual clang::MangleContext::~MangleContext ( )
inlinevirtual

Definition at line 76 of file Mangle.h.

Member Function Documentation

◆ getAnonymousStructId()

uint64_t clang::MangleContext::getAnonymousStructId ( const NamedDecl D,
const FunctionDecl FD = nullptr 
)
inline

Definition at line 92 of file Mangle.h.

References D, Id, and clang::Result.

◆ getAnonymousStructIdForDebugInfo()

uint64_t clang::MangleContext::getAnonymousStructIdForDebugInfo ( const NamedDecl D)
inline

Definition at line 106 of file Mangle.h.

References D, and clang::Result.

◆ getASTContext()

ASTContext & clang::MangleContext::getASTContext ( ) const
inline

Definition at line 78 of file Mangle.h.

Referenced by mangleName(), mangleObjCMethodName(), and shouldMangleDeclName().

◆ getBlockId()

unsigned clang::MangleContext::getBlockId ( const BlockDecl BD,
bool  Local 
)
inline

Definition at line 84 of file Mangle.h.

References clang::Result.

Referenced by mangleBlock(), and mangleGlobalBlock().

◆ getDiags()

DiagnosticsEngine & clang::MangleContext::getDiags ( ) const
inline

Definition at line 80 of file Mangle.h.

◆ getKind()

ManglerKind clang::MangleContext::getKind ( ) const
inline

Definition at line 68 of file Mangle.h.

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

◆ getLambdaString()

virtual std::string clang::MangleContext::getLambdaString ( const CXXRecordDecl Lambda)
pure virtual

◆ isAux()

bool clang::MangleContext::isAux ( ) const
inline

Definition at line 70 of file Mangle.h.

◆ isUniqueInternalLinkageDecl()

virtual bool clang::MangleContext::isUniqueInternalLinkageDecl ( const NamedDecl ND)
inlinevirtual

Definition at line 124 of file Mangle.h.

Referenced by shouldMangleDeclName().

◆ mangleBlock()

void MangleContext::mangleBlock ( const DeclContext DC,
const BlockDecl BD,
raw_ostream &  Out 
)

◆ mangleCanonicalTypeName()

virtual void clang::MangleContext::mangleCanonicalTypeName ( QualType  T,
raw_ostream &  ,
bool  NormalizeIntegers = false 
)
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().

◆ mangleCtorBlock()

void MangleContext::mangleCtorBlock ( const CXXConstructorDecl CD,
CXXCtorType  CT,
const BlockDecl BD,
raw_ostream &  Out 
)

◆ mangleCXXDtorThunk()

virtual void clang::MangleContext::mangleCXXDtorThunk ( const CXXDestructorDecl DD,
CXXDtorType  Type,
const ThunkInfo Thunk,
bool  ElideOverrideInfo,
raw_ostream &   
)
pure virtual

◆ mangleCXXName()

virtual void clang::MangleContext::mangleCXXName ( GlobalDecl  GD,
raw_ostream &   
)
pure virtual

Referenced by mangleName().

◆ mangleCXXRTTI()

virtual void clang::MangleContext::mangleCXXRTTI ( QualType  T,
raw_ostream &   
)
pure virtual

◆ mangleCXXRTTIName()

virtual void clang::MangleContext::mangleCXXRTTIName ( QualType  T,
raw_ostream &  ,
bool  NormalizeIntegers = false 
)
pure virtual

Referenced by getTypeIdentifier().

◆ mangleCXXVTable()

virtual void clang::MangleContext::mangleCXXVTable ( const CXXRecordDecl RD,
raw_ostream &   
)
pure virtual

◆ mangleDtorBlock()

void MangleContext::mangleDtorBlock ( const CXXDestructorDecl CD,
CXXDtorType  DT,
const BlockDecl BD,
raw_ostream &  Out 
)

◆ mangleDynamicAtExitDestructor()

virtual void clang::MangleContext::mangleDynamicAtExitDestructor ( const VarDecl D,
raw_ostream &   
)
pure virtual

◆ mangleDynamicInitializer()

virtual void clang::MangleContext::mangleDynamicInitializer ( const VarDecl D,
raw_ostream &   
)
pure virtual

◆ mangleGlobalBlock()

void MangleContext::mangleGlobalBlock ( const BlockDecl BD,
const NamedDecl ID,
raw_ostream &  Out 
)

◆ mangleMSGuidDecl()

void MangleContext::mangleMSGuidDecl ( const MSGuidDecl GD,
raw_ostream &  Out 
)
virtual

Definition at line 243 of file Mangle.cpp.

References clang::C, clang::MSGuidDecl::getParts(), and P.

Referenced by mangleName().

◆ mangleName()

void MangleContext::mangleName ( GlobalDecl  GD,
raw_ostream &  Out 
)

◆ mangleObjCMethodName()

void MangleContext::mangleObjCMethodName ( const ObjCMethodDecl MD,
raw_ostream &  OS,
bool  includePrefixByte = true,
bool  includeCategoryNamespace = true 
)

◆ 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().

◆ mangleReferenceTemporary()

virtual void clang::MangleContext::mangleReferenceTemporary ( const VarDecl D,
unsigned  ManglingNumber,
raw_ostream &   
)
pure virtual

◆ mangleSEHFilterExpression()

virtual void clang::MangleContext::mangleSEHFilterExpression ( GlobalDecl  EnclosingDecl,
raw_ostream &  Out 
)
pure virtual

◆ mangleSEHFinallyBlock()

virtual void clang::MangleContext::mangleSEHFinallyBlock ( GlobalDecl  EnclosingDecl,
raw_ostream &  Out 
)
pure virtual

◆ mangleStaticGuardVariable()

virtual void clang::MangleContext::mangleStaticGuardVariable ( const VarDecl D,
raw_ostream &   
)
pure virtual

◆ mangleStringLiteral()

virtual void clang::MangleContext::mangleStringLiteral ( const StringLiteral SL,
raw_ostream &   
)
pure virtual

◆ mangleThunk()

virtual void clang::MangleContext::mangleThunk ( const CXXMethodDecl MD,
const ThunkInfo Thunk,
bool  ElideOverrideInfo,
raw_ostream &   
)
pure virtual

◆ needsUniqueInternalLinkageNames()

virtual void clang::MangleContext::needsUniqueInternalLinkageNames ( )
inlinevirtual

Definition at line 128 of file Mangle.h.

Referenced by getMangledNameImpl().

◆ shouldMangleCXXName()

virtual bool clang::MangleContext::shouldMangleCXXName ( const NamedDecl D)
pure virtual

Referenced by mangleName(), and shouldMangleDeclName().

◆ shouldMangleDeclName()

bool MangleContext::shouldMangleDeclName ( const NamedDecl D)

◆ shouldMangleStringLiteral()

virtual bool clang::MangleContext::shouldMangleStringLiteral ( const StringLiteral SL)
pure virtual

◆ startNewFunction()

virtual void clang::MangleContext::startNewFunction ( )
inlinevirtual

Definition at line 82 of file Mangle.h.


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