clang API Documentation
#include <Mangle.h>
Public Types | |
enum | ManglerKind { MK_Itanium, MK_Microsoft } |
Public Member Functions | |
ManglerKind | getKind () const |
MangleContext (ASTContext &Context, DiagnosticsEngine &Diags, ManglerKind Kind) | |
virtual | ~MangleContext () |
ASTContext & | getASTContext () const |
DiagnosticsEngine & | getDiags () 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 | 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 | mangleTypeName (QualType T, raw_ostream &)=0 |
MangleContext - Context for tracking state which persists across multiple calls to the C++ name mangler.
clang::MangleContext::MangleContext | ( | ASTContext & | Context, |
DiagnosticsEngine & | Diags, | ||
ManglerKind | Kind | ||
) | [inline, explicit] |
virtual clang::MangleContext::~MangleContext | ( | ) | [inline, virtual] |
uint64_t clang::MangleContext::getAnonymousStructId | ( | const TagDecl * | TD | ) | [inline] |
ASTContext& clang::MangleContext::getASTContext | ( | ) | const [inline] |
Definition at line 69 of file Mangle.h.
Referenced by mangleName(), and shouldMangleDeclName().
unsigned clang::MangleContext::getBlockId | ( | const BlockDecl * | BD, |
bool | Local | ||
) | [inline] |
Definition at line 75 of file Mangle.h.
Referenced by mangleBlock(), mangleFunctionBlock(), and mangleGlobalBlock().
DiagnosticsEngine& clang::MangleContext::getDiags | ( | ) | const [inline] |
ManglerKind clang::MangleContext::getKind | ( | ) | const [inline] |
Definition at line 60 of file Mangle.h.
Referenced by clang::ItaniumMangleContext::classof(), and clang::MicrosoftMangleContext::classof().
void MangleContext::mangleBlock | ( | const DeclContext * | DC, |
const BlockDecl * | BD, | ||
raw_ostream & | Out | ||
) |
Definition at line 223 of file Mangle.cpp.
References getBlockId(), clang::DeclContext::getParent(), mangleFunctionBlock(), mangleName(), mangleObjCMethodName(), and shouldMangleDeclName().
Referenced by clang::CodeGen::CodeGenModule::getBlockMangledName().
void MangleContext::mangleCtorBlock | ( | const CXXConstructorDecl * | CD, |
CXXCtorType | CT, | ||
const BlockDecl * | BD, | ||
raw_ostream & | Out | ||
) |
Definition at line 203 of file Mangle.cpp.
References mangleCXXCtor(), and mangleFunctionBlock().
Referenced by clang::CodeGen::CodeGenModule::getBlockMangledName().
virtual void clang::MangleContext::mangleCXXCtor | ( | const CXXConstructorDecl * | D, |
CXXCtorType | Type, | ||
raw_ostream & | |||
) | [pure virtual] |
Referenced by clang::CodeGen::CodeGenModule::getMangledName(), and mangleCtorBlock().
virtual void clang::MangleContext::mangleCXXDtor | ( | const CXXDestructorDecl * | D, |
CXXDtorType | Type, | ||
raw_ostream & | |||
) | [pure virtual] |
Referenced by clang::CodeGen::CodeGenModule::getMangledName(), and mangleDtorBlock().
virtual void clang::MangleContext::mangleCXXDtorThunk | ( | const CXXDestructorDecl * | DD, |
CXXDtorType | Type, | ||
const ThisAdjustment & | ThisAdjustment, | ||
raw_ostream & | |||
) | [pure virtual] |
Referenced by clang::CodeGen::CodeGenModule::GetAddrOfThunk().
virtual void clang::MangleContext::mangleCXXName | ( | const NamedDecl * | D, |
raw_ostream & | |||
) | [pure virtual] |
Referenced by mangleName().
virtual void clang::MangleContext::mangleCXXRTTI | ( | QualType | T, |
raw_ostream & | |||
) | [pure virtual] |
Referenced by clang::CodeGen::CodeGenFunction::EmitTypeCheck().
virtual void clang::MangleContext::mangleCXXRTTIName | ( | QualType | T, |
raw_ostream & | |||
) | [pure virtual] |
Referenced by getUniqueTagTypeName().
void MangleContext::mangleDtorBlock | ( | const CXXDestructorDecl * | CD, |
CXXDtorType | DT, | ||
const BlockDecl * | BD, | ||
raw_ostream & | Out | ||
) |
Definition at line 213 of file Mangle.cpp.
References mangleCXXDtor(), and mangleFunctionBlock().
Referenced by clang::CodeGen::CodeGenModule::getBlockMangledName().
virtual void clang::MangleContext::mangleDynamicAtExitDestructor | ( | const VarDecl * | D, |
raw_ostream & | |||
) | [pure virtual] |
Referenced by clang::CodeGen::CodeGenFunction::createAtExitStub().
virtual void clang::MangleContext::mangleDynamicInitializer | ( | const VarDecl * | D, |
raw_ostream & | |||
) | [pure virtual] |
void MangleContext::mangleGlobalBlock | ( | const BlockDecl * | BD, |
const NamedDecl * | ID, | ||
raw_ostream & | Out | ||
) |
Definition at line 186 of file Mangle.cpp.
References getBlockId(), clang::NamedDecl::getIdentifier(), clang::IdentifierInfo::getName(), mangleName(), and shouldMangleDeclName().
Referenced by clang::CodeGen::CodeGenModule::getBlockMangledName().
void MangleContext::mangleName | ( | const NamedDecl * | D, |
raw_ostream & | Out | ||
) |
Definition at line 117 of file Mangle.cpp.
References clang::Type::castAs(), CCM_Fast, CCM_Other, CCM_Std, CCM_Vector, getASTContext(), clang::Decl::getAttr(), getCallingConvMangling(), clang::TargetInfo::getCXXABI(), clang::NamedDecl::getIdentifier(), clang::IdentifierInfo::getName(), clang::TargetInfo::getPointerWidth(), clang::ASTContext::getTargetInfo(), clang::ValueDecl::getType(), clang::ASTContext::getTypeSize(), clang::TargetInfo::getUserLabelPrefix(), mangleCXXName(), mangleObjCMethodName(), clang::TargetCXXABI::Microsoft, and shouldMangleCXXName().
Referenced by clang::CodeGen::CodeGenModule::getMangledName(), mangleBlock(), and mangleGlobalBlock().
void MangleContext::mangleObjCMethodName | ( | const ObjCMethodDecl * | MD, |
raw_ostream & | Out | ||
) |
Definition at line 256 of file Mangle.cpp.
References clang::Decl::getDeclContext(), clang::NamedDecl::getName(), clang::ObjCMethodDecl::getSelector(), clang::ObjCMethodDecl::isInstanceMethod(), and clang::Selector::print().
Referenced by mangleBlock(), and mangleName().
virtual void clang::MangleContext::mangleReferenceTemporary | ( | const VarDecl * | D, |
unsigned | ManglingNumber, | ||
raw_ostream & | |||
) | [pure virtual] |
Referenced by clang::CodeGen::CodeGenModule::GetAddrOfGlobalTemporary().
virtual void clang::MangleContext::mangleStaticGuardVariable | ( | const VarDecl * | D, |
raw_ostream & | |||
) | [pure virtual] |
virtual void clang::MangleContext::mangleStringLiteral | ( | const StringLiteral * | SL, |
raw_ostream & | |||
) | [pure virtual] |
virtual void clang::MangleContext::mangleThunk | ( | const CXXMethodDecl * | MD, |
const ThunkInfo & | Thunk, | ||
raw_ostream & | |||
) | [pure virtual] |
Referenced by clang::CodeGen::CodeGenModule::GetAddrOfThunk().
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::CodeGenTBAA::getTBAAInfo(), and clang::CodeGen::CodeGenTBAA::getTBAAStructTypeInfo().
virtual bool clang::MangleContext::shouldMangleCXXName | ( | const NamedDecl * | D | ) | [pure virtual] |
Referenced by mangleName(), and shouldMangleDeclName().
bool MangleContext::shouldMangleDeclName | ( | const NamedDecl * | D | ) |
Definition at line 98 of file Mangle.cpp.
References CCM_Other, clang::frontend::CPlusPlus, getASTContext(), getCallingConvMangling(), clang::Decl::hasAttr(), clang::Decl::hasAttrs(), and shouldMangleCXXName().
Referenced by clang::CodeGen::CodeGenModule::getMangledName(), mangleBlock(), and mangleGlobalBlock().
virtual bool clang::MangleContext::shouldMangleStringLiteral | ( | const StringLiteral * | SL | ) | [pure virtual] |
virtual void clang::MangleContext::startNewFunction | ( | ) | [inline, virtual] |
Definition at line 73 of file Mangle.h.
Referenced by clang::CodeGen::CodeGenFunction::CodeGenFunction().