clang  14.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
 
 MangleContext (ASTContext &Context, DiagnosticsEngine &Diags, ManglerKind Kind)
 
virtual ~MangleContext ()
 
ASTContextgetASTContext () const
 
DiagnosticsEnginegetDiags () const
 
virtual void startNewFunction ()
 
unsigned getBlockId (const BlockDecl *BD, bool Local)
 
uint64_t getAnonymousStructId (const NamedDecl *D)
 
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, raw_ostream &)=0
 
virtual void mangleCXXDtorThunk (const CXXDestructorDecl *DD, CXXDtorType Type, const ThisAdjustment &ThisAdjustment, raw_ostream &)=0
 
virtual void mangleReferenceTemporary (const VarDecl *D, unsigned ManglingNumber, raw_ostream &)=0
 
virtual void mangleCXXRTTI (QualType T, raw_ostream &)=0
 
virtual void mangleCXXRTTIName (QualType T, raw_ostream &)=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 (const NamedDecl *EnclosingDecl, raw_ostream &Out)=0
 
virtual void mangleSEHFinallyBlock (const NamedDecl *EnclosingDecl, raw_ostream &Out)=0
 
virtual void mangleTypeName (QualType T, raw_ostream &)=0
 Generates a unique string for an externally visible type for use with TBAA or type uniquing. More...
 

Detailed Description

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

Definition at line 44 of file Mangle.h.

Member Enumeration Documentation

◆ ManglerKind

Enumerator
MK_Itanium 
MK_Microsoft 

Definition at line 46 of file Mangle.h.

Constructor & Destructor Documentation

◆ MangleContext()

clang::MangleContext::MangleContext ( ASTContext Context,
DiagnosticsEngine Diags,
ManglerKind  Kind 
)
inlineexplicit

Definition at line 65 of file Mangle.h.

◆ ~MangleContext()

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

Definition at line 70 of file Mangle.h.

Member Function Documentation

◆ getAnonymousStructId()

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

Definition at line 86 of file Mangle.h.

◆ getAnonymousStructIdForDebugInfo()

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

Definition at line 92 of file Mangle.h.

◆ getASTContext()

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

Definition at line 72 of file Mangle.h.

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

◆ getBlockId()

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

Definition at line 78 of file Mangle.h.

Referenced by mangleBlock(), and mangleGlobalBlock().

◆ getDiags()

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

Definition at line 74 of file Mangle.h.

◆ getKind()

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

Definition at line 63 of file Mangle.h.

◆ getLambdaString()

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

◆ isUniqueInternalLinkageDecl()

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

Definition at line 110 of file Mangle.h.

Referenced by shouldMangleDeclName().

◆ mangleBlock()

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

◆ 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 ThisAdjustment ThisAdjustment,
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 &   
)
pure virtual

Referenced by getTypeIdentifier().

◆ 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 236 of file Mangle.cpp.

References 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 378 of file Mangle.cpp.

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 ( const NamedDecl EnclosingDecl,
raw_ostream &  Out 
)
pure virtual

◆ mangleSEHFinallyBlock()

virtual void clang::MangleContext::mangleSEHFinallyBlock ( const NamedDecl 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,
raw_ostream &   
)
pure virtual

◆ mangleTypeName()

virtual void clang::MangleContext::mangleTypeName ( QualType  T,
raw_ostream &   
)
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::CGOpenMPRuntime::emitUserDefinedMapper(), clang::CodeGen::CodeGenModule::EmitVTableTypeMetadata(), and getBlockCaptureStr().

◆ needsUniqueInternalLinkageNames()

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

Definition at line 114 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 76 of file Mangle.h.


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