clang  6.0.0svn
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 TagDecl *TD)
 
Mangler Entry Points
bool shouldMangleDeclName (const NamedDecl *D)
 
virtual bool shouldMangleCXXName (const NamedDecl *D)=0
 
virtual bool shouldMangleStringLiteral (const StringLiteral *SL)=0
 
void mangleName (const NamedDecl *D, raw_ostream &)
 
virtual void mangleCXXName (const NamedDecl *D, 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 mangleCXXCtor (const CXXConstructorDecl *D, CXXCtorType Type, raw_ostream &)=0
 
virtual void mangleCXXDtor (const CXXDestructorDecl *D, CXXDtorType Type, raw_ostream &)=0
 
virtual void mangleStringLiteral (const StringLiteral *SL, raw_ostream &)=0
 
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 mangleObjCMethodNameWithoutSize (const ObjCMethodDecl *MD, raw_ostream &)
 
void mangleObjCMethodName (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 42 of file Mangle.h.

Member Enumeration Documentation

◆ ManglerKind

Enumerator
MK_Itanium 
MK_Microsoft 

Definition at line 44 of file Mangle.h.

Constructor & Destructor Documentation

◆ MangleContext()

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

Definition at line 63 of file Mangle.h.

◆ ~MangleContext()

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

Definition at line 68 of file Mangle.h.

Member Function Documentation

◆ getAnonymousStructId()

uint64_t clang::MangleContext::getAnonymousStructId ( const TagDecl TD)
inline

Definition at line 84 of file Mangle.h.

References clang::T.

◆ getASTContext()

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

Definition at line 70 of file Mangle.h.

Referenced by mangleName(), and shouldMangleDeclName().

◆ getBlockId()

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

Definition at line 76 of file Mangle.h.

Referenced by mangleGlobalBlock().

◆ getDiags()

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

Definition at line 72 of file Mangle.h.

◆ getKind()

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

◆ mangleBlock()

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

Definition at line 229 of file Mangle.cpp.

◆ mangleCtorBlock()

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

Definition at line 211 of file Mangle.cpp.

◆ mangleCXXCtor()

virtual void clang::MangleContext::mangleCXXCtor ( const CXXConstructorDecl D,
CXXCtorType  Type,
raw_ostream &   
)
pure virtual

◆ mangleCXXDtor()

virtual void clang::MangleContext::mangleCXXDtor ( const CXXDestructorDecl D,
CXXDtorType  Type,
raw_ostream &   
)
pure virtual

◆ mangleCXXDtorThunk()

virtual void clang::MangleContext::mangleCXXDtorThunk ( const CXXDestructorDecl DD,
CXXDtorType  Type,
const ThisAdjustment ThisAdjustment,
raw_ostream &   
)
pure virtual

◆ mangleCXXName()

virtual void clang::MangleContext::mangleCXXName ( const NamedDecl D,
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 getUniqueTagTypeName().

◆ mangleDtorBlock()

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

Definition at line 220 of file Mangle.cpp.

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

◆ mangleName()

void MangleContext::mangleName ( const NamedDecl D,
raw_ostream &  Out 
)

◆ mangleObjCMethodName()

void MangleContext::mangleObjCMethodName ( const ObjCMethodDecl MD,
raw_ostream &  Out 
)

Definition at line 282 of file Mangle.cpp.

Referenced by mangleName().

◆ mangleObjCMethodNameWithoutSize()

void MangleContext::mangleObjCMethodNameWithoutSize ( const ObjCMethodDecl MD,
raw_ostream &  OS 
)

◆ 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::CodeGenModule::CreateMetadataIdentifierForType(), clang::CodeGen::CodeGenTBAA::getBaseTypeInfo(), and clang::CodeGen::CodeGenTBAA::getTypeInfo().

◆ 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 74 of file Mangle.h.


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