clang  6.0.0svn
Classes | Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
clang::CodeGen::CGCXXABI Class Referenceabstract

Implements C++ ABI-specific code generation functions. More...

#include "/opt/doxygen-docs/src/llvm/tools/clang/lib/CodeGen/CGCXXABI.h"

Collaboration diagram for clang::CodeGen::CGCXXABI:
Collaboration graph
[legend]

Classes

struct  AddedStructorArgs
 Notes how many arguments were added to the beginning (Prefix) and ending (Suffix) of an arg list. More...
 

Public Types

enum  RecordArgABI { RAA_Default = 0, RAA_DirectInMemory, RAA_Indirect }
 Specify how one should pass an argument of a record type. More...
 

Public Member Functions

virtual ~CGCXXABI ()
 
MangleContextgetMangleContext ()
 Gets the mangle context. More...
 
virtual bool HasThisReturn (GlobalDecl GD) const
 Returns true if the given constructor or destructor is one of the kinds that the ABI says returns 'this' (only applies when called non-virtually for destructors). More...
 
virtual bool hasMostDerivedReturn (GlobalDecl GD) const
 
virtual bool canCallMismatchedFunctionType () const
 Returns true if the target allows calling a function through a pointer with a different signature than the actual function (or equivalently, bitcasting a function or function pointer to a different function type). More...
 
virtual bool classifyReturnType (CGFunctionInfo &FI) const =0
 If the C++ ABI requires the given type be returned in a particular way, this method sets RetAI and returns true. More...
 
bool canCopyArgument (const CXXRecordDecl *RD) const
 Returns true if C++ allows us to copy the memory of an object of type RD when it is passed as an argument. More...
 
virtual RecordArgABI getRecordArgABI (const CXXRecordDecl *RD) const =0
 Returns how an argument of the given record type should be passed. More...
 
virtual bool isSRetParameterAfterThis () const
 Returns true if the implicit 'sret' parameter comes after the implicit 'this' parameter of C++ instance methods. More...
 
virtual llvm::TypeConvertMemberPointerType (const MemberPointerType *MPT)
 Find the LLVM type used to represent the given member pointer type. More...
 
virtual CGCallee EmitLoadOfMemberFunctionPointer (CodeGenFunction &CGF, const Expr *E, Address This, llvm::Value *&ThisPtrForCall, llvm::Value *MemPtr, const MemberPointerType *MPT)
 Load a member function from an object and a member function pointer. More...
 
virtual llvm::ValueEmitMemberDataPointerAddress (CodeGenFunction &CGF, const Expr *E, Address Base, llvm::Value *MemPtr, const MemberPointerType *MPT)
 Calculate an l-value from an object and a data member pointer. More...
 
virtual llvm::ValueEmitMemberPointerConversion (CodeGenFunction &CGF, const CastExpr *E, llvm::Value *Src)
 Perform a derived-to-base, base-to-derived, or bitcast member pointer conversion. More...
 
virtual llvm::Constant * EmitMemberPointerConversion (const CastExpr *E, llvm::Constant *Src)
 Perform a derived-to-base, base-to-derived, or bitcast member pointer conversion on a constant value. More...
 
virtual bool isZeroInitializable (const MemberPointerType *MPT)
 Return true if the given member pointer can be zero-initialized (in the C++ sense) with an LLVM zeroinitializer. More...
 
virtual bool isMemberPointerConvertible (const MemberPointerType *MPT) const
 Return whether or not a member pointers type is convertible to an IR type. More...
 
virtual llvm::Constant * EmitNullMemberPointer (const MemberPointerType *MPT)
 Create a null member pointer of the given type. More...
 
virtual llvm::Constant * EmitMemberFunctionPointer (const CXXMethodDecl *MD)
 Create a member pointer for the given method. More...
 
virtual llvm::Constant * EmitMemberDataPointer (const MemberPointerType *MPT, CharUnits offset)
 Create a member pointer for the given field. More...
 
virtual llvm::Constant * EmitMemberPointer (const APValue &MP, QualType MPT)
 Create a member pointer for the given member pointer constant. More...
 
virtual llvm::ValueEmitMemberPointerComparison (CodeGenFunction &CGF, llvm::Value *L, llvm::Value *R, const MemberPointerType *MPT, bool Inequality)
 Emit a comparison between two member pointers. Returns an i1. More...
 
virtual llvm::ValueEmitMemberPointerIsNotNull (CodeGenFunction &CGF, llvm::Value *MemPtr, const MemberPointerType *MPT)
 Determine if a member pointer is non-null. Returns an i1. More...
 
virtual void emitVirtualObjectDelete (CodeGenFunction &CGF, const CXXDeleteExpr *DE, Address Ptr, QualType ElementType, const CXXDestructorDecl *Dtor)=0
 
virtual void emitRethrow (CodeGenFunction &CGF, bool isNoReturn)=0
 
virtual void emitThrow (CodeGenFunction &CGF, const CXXThrowExpr *E)=0
 
virtual llvm::GlobalVariable * getThrowInfo (QualType T)
 
virtual bool canSpeculativelyEmitVTable (const CXXRecordDecl *RD) const =0
 Determine whether it's possible to emit a vtable for RD, even though we do not know that the vtable has been marked as used by semantic analysis. More...
 
virtual void emitBeginCatch (CodeGenFunction &CGF, const CXXCatchStmt *C)=0
 
virtual llvm::CallInst * emitTerminateForUnexpectedException (CodeGenFunction &CGF, llvm::Value *Exn)
 
virtual llvm::Constant * getAddrOfRTTIDescriptor (QualType Ty)=0
 
virtual CatchTypeInfo getAddrOfCXXCatchHandlerType (QualType Ty, QualType CatchHandlerType)=0
 
virtual CatchTypeInfo getCatchAllTypeInfo ()
 
virtual bool shouldTypeidBeNullChecked (bool IsDeref, QualType SrcRecordTy)=0
 
virtual void EmitBadTypeidCall (CodeGenFunction &CGF)=0
 
virtual llvm::ValueEmitTypeid (CodeGenFunction &CGF, QualType SrcRecordTy, Address ThisPtr, llvm::Type *StdTypeInfoPtrTy)=0
 
virtual bool shouldDynamicCastCallBeNullChecked (bool SrcIsPtr, QualType SrcRecordTy)=0
 
virtual llvm::ValueEmitDynamicCastCall (CodeGenFunction &CGF, Address Value, QualType SrcRecordTy, QualType DestTy, QualType DestRecordTy, llvm::BasicBlock *CastEnd)=0
 
virtual llvm::ValueEmitDynamicCastToVoid (CodeGenFunction &CGF, Address Value, QualType SrcRecordTy, QualType DestTy)=0
 
virtual bool EmitBadCastCall (CodeGenFunction &CGF)=0
 
virtual llvm::ValueGetVirtualBaseClassOffset (CodeGenFunction &CGF, Address This, const CXXRecordDecl *ClassDecl, const CXXRecordDecl *BaseClassDecl)=0
 
virtual llvm::BasicBlock * EmitCtorCompleteObjectHandler (CodeGenFunction &CGF, const CXXRecordDecl *RD)
 
virtual void initializeHiddenVirtualInheritanceMembers (CodeGenFunction &CGF, const CXXRecordDecl *RD)
 Emit the code to initialize hidden members required to handle virtual inheritance, if needed by the ABI. More...
 
virtual void EmitCXXConstructors (const CXXConstructorDecl *D)=0
 Emit constructor variants required by this ABI. More...
 
virtual AddedStructorArgs buildStructorSignature (const CXXMethodDecl *MD, StructorType T, SmallVectorImpl< CanQualType > &ArgTys)=0
 Build the signature of the given constructor or destructor variant by adding any required parameters. More...
 
virtual bool useThunkForDtorVariant (const CXXDestructorDecl *Dtor, CXXDtorType DT) const =0
 Returns true if the given destructor type should be emitted as a linkonce delegating thunk, regardless of whether the dtor is defined in this TU or not. More...
 
virtual void EmitCXXDestructors (const CXXDestructorDecl *D)=0
 Emit destructor variants required by this ABI. More...
 
virtual const CXXRecordDeclgetThisArgumentTypeForMethod (const CXXMethodDecl *MD)
 Get the type of the implicit "this" parameter used by a method. More...
 
virtual Address adjustThisArgumentForVirtualFunctionCall (CodeGenFunction &CGF, GlobalDecl GD, Address This, bool VirtualCall)
 Perform ABI-specific "this" argument adjustment required prior to a call of a virtual function. More...
 
void buildThisParam (CodeGenFunction &CGF, FunctionArgList &Params)
 Build a parameter variable suitable for 'this'. More...
 
virtual void addImplicitStructorParams (CodeGenFunction &CGF, QualType &ResTy, FunctionArgList &Params)=0
 Insert any ABI-specific implicit parameters into the parameter list for a function. More...
 
virtual CharUnits getVirtualFunctionPrologueThisAdjustment (GlobalDecl GD)
 Get the ABI-specific "this" parameter adjustment to apply in the prologue of a virtual function. More...
 
virtual void EmitInstanceFunctionProlog (CodeGenFunction &CGF)=0
 Emit the ABI-specific prolog for the function. More...
 
virtual AddedStructorArgs addImplicitConstructorArgs (CodeGenFunction &CGF, const CXXConstructorDecl *D, CXXCtorType Type, bool ForVirtualBase, bool Delegating, CallArgList &Args)=0
 Add any ABI-specific implicit arguments needed to call a constructor. More...
 
virtual void EmitDestructorCall (CodeGenFunction &CGF, const CXXDestructorDecl *DD, CXXDtorType Type, bool ForVirtualBase, bool Delegating, Address This)=0
 Emit the destructor call. More...
 
virtual void emitVTableDefinitions (CodeGenVTables &CGVT, const CXXRecordDecl *RD)=0
 Emits the VTable definitions required for the given record type. More...
 
virtual bool isVirtualOffsetNeededForVTableField (CodeGenFunction &CGF, CodeGenFunction::VPtr Vptr)=0
 Checks if ABI requires extra virtual offset for vtable field. More...
 
virtual bool doStructorsInitializeVPtrs (const CXXRecordDecl *VTableClass)=0
 Checks if ABI requires to initialize vptrs for given dynamic class. More...
 
virtual llvm::Constant * getVTableAddressPoint (BaseSubobject Base, const CXXRecordDecl *VTableClass)=0
 Get the address point of the vtable for the given base subobject. More...
 
virtual llvm::ValuegetVTableAddressPointInStructor (CodeGenFunction &CGF, const CXXRecordDecl *RD, BaseSubobject Base, const CXXRecordDecl *NearestVBase)=0
 Get the address point of the vtable for the given base subobject while building a constructor or a destructor. More...
 
virtual llvm::Constant * getVTableAddressPointForConstExpr (BaseSubobject Base, const CXXRecordDecl *VTableClass)=0
 Get the address point of the vtable for the given base subobject while building a constexpr. More...
 
virtual llvm::GlobalVariable * getAddrOfVTable (const CXXRecordDecl *RD, CharUnits VPtrOffset)=0
 Get the address of the vtable for the given record decl which should be used for the vptr at the given offset in RD. More...
 
virtual CGCallee getVirtualFunctionPointer (CodeGenFunction &CGF, GlobalDecl GD, Address This, llvm::Type *Ty, SourceLocation Loc)=0
 Build a virtual function pointer in the ABI-specific way. More...
 
virtual llvm::ValueEmitVirtualDestructorCall (CodeGenFunction &CGF, const CXXDestructorDecl *Dtor, CXXDtorType DtorType, Address This, const CXXMemberCallExpr *CE)=0
 Emit the ABI-specific virtual destructor call. More...
 
virtual void adjustCallArgsForDestructorThunk (CodeGenFunction &CGF, GlobalDecl GD, CallArgList &CallArgs)
 
virtual void emitVirtualInheritanceTables (const CXXRecordDecl *RD)=0
 Emit any tables needed to implement virtual inheritance. More...
 
virtual void setThunkLinkage (llvm::Function *Thunk, bool ForVTable, GlobalDecl GD, bool ReturnAdjustment)=0
 
virtual llvm::ValueperformThisAdjustment (CodeGenFunction &CGF, Address This, const ThisAdjustment &TA)=0
 
virtual llvm::ValueperformReturnAdjustment (CodeGenFunction &CGF, Address Ret, const ReturnAdjustment &RA)=0
 
virtual void EmitReturnFromThunk (CodeGenFunction &CGF, RValue RV, QualType ResultType)
 
virtual size_t getSrcArgforCopyCtor (const CXXConstructorDecl *, FunctionArgList &Args) const =0
 
virtual std::vector< CharUnitsgetVBPtrOffsets (const CXXRecordDecl *RD)
 Gets the offsets of all the virtual base pointers in a given class. More...
 
virtual StringRef GetPureVirtualCallName ()=0
 Gets the pure virtual member call function. More...
 
virtual StringRef GetDeletedVirtualCallName ()=0
 Gets the deleted virtual member call name. More...
 
virtual CharUnits GetArrayCookieSize (const CXXNewExpr *expr)
 Returns the extra size required in order to store the array cookie for the given new-expression. More...
 
virtual Address InitializeArrayCookie (CodeGenFunction &CGF, Address NewPtr, llvm::Value *NumElements, const CXXNewExpr *expr, QualType ElementType)
 Initialize the array cookie for the given allocation. More...
 
virtual void ReadArrayCookie (CodeGenFunction &CGF, Address Ptr, const CXXDeleteExpr *expr, QualType ElementType, llvm::Value *&NumElements, llvm::Value *&AllocPtr, CharUnits &CookieSize)
 Reads the array cookie associated with the given pointer, if it has one. More...
 
virtual bool NeedsVTTParameter (GlobalDecl GD)
 Return whether the given global decl needs a VTT parameter. More...
 
virtual void EmitGuardedInit (CodeGenFunction &CGF, const VarDecl &D, llvm::GlobalVariable *DeclPtr, bool PerformInit)=0
 Emits the guarded initializer and destructor setup for the given variable, given that it couldn't be emitted as a constant. More...
 
virtual void registerGlobalDtor (CodeGenFunction &CGF, const VarDecl &D, llvm::Constant *Dtor, llvm::Constant *Addr)=0
 Emit code to force the execution of a destructor during global teardown. More...
 
virtual void EmitThreadLocalInitFuncs (CodeGenModule &CGM, ArrayRef< const VarDecl *> CXXThreadLocals, ArrayRef< llvm::Function *> CXXThreadLocalInits, ArrayRef< const VarDecl *> CXXThreadLocalInitVars)=0
 Emits ABI-required functions necessary to initialize thread_local variables in this translation unit. More...
 
virtual bool usesThreadWrapperFunction () const =0
 
virtual LValue EmitThreadLocalVarDeclLValue (CodeGenFunction &CGF, const VarDecl *VD, QualType LValType)=0
 Emit a reference to a non-local thread_local variable (including triggering the initialization of all thread_local variables in its translation unit). More...
 
virtual void emitCXXStructor (const CXXMethodDecl *MD, StructorType Type)=0
 Emit a single constructor/destructor with the given type from a C++ constructor Decl. More...
 

Protected Member Functions

 CGCXXABI (CodeGenModule &CGM)
 
ImplicitParamDeclgetThisDecl (CodeGenFunction &CGF)
 
llvm::ValuegetThisValue (CodeGenFunction &CGF)
 
Address getThisAddress (CodeGenFunction &CGF)
 
void ErrorUnsupportedABI (CodeGenFunction &CGF, StringRef S)
 Issue a diagnostic about unsupported features in the ABI. More...
 
llvm::Constant * GetBogusMemberPointer (QualType T)
 Get a null value for unsupported member pointers. More...
 
ImplicitParamDecl *& getStructorImplicitParamDecl (CodeGenFunction &CGF)
 
llvm::Value *& getStructorImplicitParamValue (CodeGenFunction &CGF)
 
llvm::ValueloadIncomingCXXThis (CodeGenFunction &CGF)
 Loads the incoming C++ this pointer as it was passed by the caller. More...
 
void setCXXABIThisValue (CodeGenFunction &CGF, llvm::Value *ThisPtr)
 
ASTContextgetContext () const
 
virtual bool requiresArrayCookie (const CXXDeleteExpr *E, QualType eltType)
 
virtual bool requiresArrayCookie (const CXXNewExpr *E)
 
virtual bool isThisCompleteObject (GlobalDecl GD) const =0
 Determine whether there's something special about the rules of the ABI tell us that 'this' is a complete object within the given function. More...
 
llvm::Constant * getMemberPointerAdjustment (const CastExpr *E)
 A utility method for computing the offset required for the given base-to-derived or derived-to-base member-pointer conversion. More...
 
CharUnits getMemberPointerPathAdjustment (const APValue &MP)
 Computes the non-virtual adjustment needed for a member pointer conversion along an inheritance path stored in an APValue. More...
 
virtual CharUnits getArrayCookieSizeImpl (QualType elementType)
 Returns the extra size required in order to store the array cookie for the given type. More...
 
virtual llvm::ValuereadArrayCookieImpl (CodeGenFunction &IGF, Address ptr, CharUnits cookieSize)
 Reads the array cookie for an allocation which is known to have one. More...
 

Protected Attributes

CodeGenModuleCGM
 
std::unique_ptr< MangleContextMangleCtx
 

Detailed Description

Implements C++ ABI-specific code generation functions.

Definition at line 44 of file CGCXXABI.h.

Member Enumeration Documentation

◆ RecordArgABI

Specify how one should pass an argument of a record type.

Enumerator
RAA_Default 

Pass it using the normal C aggregate rules for the ABI, potentially introducing extra copies and passing some or all of it in registers.

RAA_DirectInMemory 

Pass it on the stack using its defined layout.

The argument must be evaluated directly into the correct stack position in the arguments area, and the call machinery must not move it or introduce extra copies.

RAA_Indirect 

Pass it as a pointer to temporary memory.

Definition at line 126 of file CGCXXABI.h.

Constructor & Destructor Documentation

◆ CGCXXABI()

clang::CodeGen::CGCXXABI::CGCXXABI ( CodeGenModule CGM)
inlineprotected

Definition at line 49 of file CGCXXABI.h.

◆ ~CGCXXABI()

CGCXXABI::~CGCXXABI ( )
virtual

Definition at line 21 of file CGCXXABI.cpp.

Member Function Documentation

◆ addImplicitConstructorArgs()

virtual AddedStructorArgs clang::CodeGen::CGCXXABI::addImplicitConstructorArgs ( CodeGenFunction CGF,
const CXXConstructorDecl D,
CXXCtorType  Type,
bool  ForVirtualBase,
bool  Delegating,
CallArgList Args 
)
pure virtual

Add any ABI-specific implicit arguments needed to call a constructor.

Returns
The number of arguments added at the beginning and end of the call, which is typically zero or one.

◆ addImplicitStructorParams()

virtual void clang::CodeGen::CGCXXABI::addImplicitStructorParams ( CodeGenFunction CGF,
QualType ResTy,
FunctionArgList Params 
)
pure virtual

Insert any ABI-specific implicit parameters into the parameter list for a function.

This generally involves extra data for constructors and destructors.

ABIs may also choose to override the return type, which has been initialized with the type of 'this' if HasThisReturn(CGF.CurGD) is true or the formal return type of the function otherwise.

Referenced by clang::CodeGen::CodeGenFunction::BuildFunctionArgList(), and clang::CodeGen::CodeGenFunction::StartThunk().

◆ adjustCallArgsForDestructorThunk()

virtual void clang::CodeGen::CGCXXABI::adjustCallArgsForDestructorThunk ( CodeGenFunction CGF,
GlobalDecl  GD,
CallArgList CallArgs 
)
inlinevirtual

◆ adjustThisArgumentForVirtualFunctionCall()

virtual Address clang::CodeGen::CGCXXABI::adjustThisArgumentForVirtualFunctionCall ( CodeGenFunction CGF,
GlobalDecl  GD,
Address  This,
bool  VirtualCall 
)
inlinevirtual

Perform ABI-specific "this" argument adjustment required prior to a call of a virtual function.

The "VirtualCall" argument is true iff the call itself is virtual.

Definition at line 338 of file CGCXXABI.h.

◆ buildStructorSignature()

virtual AddedStructorArgs clang::CodeGen::CGCXXABI::buildStructorSignature ( const CXXMethodDecl MD,
StructorType  T,
SmallVectorImpl< CanQualType > &  ArgTys 
)
pure virtual

Build the signature of the given constructor or destructor variant by adding any required parameters.

For convenience, ArgTys has been initialized with the type of 'this'.

Referenced by clang::CodeGen::CodeGenTypes::arrangeCXXStructorDeclaration().

◆ buildThisParam()

void CGCXXABI::buildThisParam ( CodeGenFunction CGF,
FunctionArgList Params 
)

◆ canCallMismatchedFunctionType()

virtual bool clang::CodeGen::CGCXXABI::canCallMismatchedFunctionType ( ) const
inlinevirtual

Returns true if the target allows calling a function through a pointer with a different signature than the actual function (or equivalently, bitcasting a function or function pointer to a different function type).

In principle in the most general case this could depend on the target, the calling convention, and the actual types of the arguments and return value. Here it just means whether the signature mismatch could ever be allowed; in other words, does the target do strict checking of signatures for all calls.

Definition at line 119 of file CGCXXABI.h.

References clang::CodeGen::swiftcall::classifyReturnType().

Referenced by EmitDeclDestroy().

◆ canCopyArgument()

bool CGCXXABI::canCopyArgument ( const CXXRecordDecl RD) const

Returns true if C++ allows us to copy the memory of an object of type RD when it is passed as an argument.

Definition at line 32 of file CGCXXABI.cpp.

References clang::CXXRecordDecl::canPassInRegisters().

◆ canSpeculativelyEmitVTable()

virtual bool clang::CodeGen::CGCXXABI::canSpeculativelyEmitVTable ( const CXXRecordDecl RD) const
pure virtual

Determine whether it's possible to emit a vtable for RD, even though we do not know that the vtable has been marked as used by semantic analysis.

Referenced by shouldEmitAvailableExternallyVTable().

◆ classifyReturnType()

virtual bool clang::CodeGen::CGCXXABI::classifyReturnType ( CGFunctionInfo FI) const
pure virtual

If the C++ ABI requires the given type be returned in a particular way, this method sets RetAI and returns true.

◆ ConvertMemberPointerType()

llvm::Type * CGCXXABI::ConvertMemberPointerType ( const MemberPointerType MPT)
virtual

◆ doStructorsInitializeVPtrs()

virtual bool clang::CodeGen::CGCXXABI::doStructorsInitializeVPtrs ( const CXXRecordDecl VTableClass)
pure virtual

Checks if ABI requires to initialize vptrs for given dynamic class.

◆ EmitBadCastCall()

virtual bool clang::CodeGen::CGCXXABI::EmitBadCastCall ( CodeGenFunction CGF)
pure virtual

Referenced by EmitDynamicCastToNull().

◆ EmitBadTypeidCall()

virtual void clang::CodeGen::CGCXXABI::EmitBadTypeidCall ( CodeGenFunction CGF)
pure virtual

◆ emitBeginCatch()

virtual void clang::CodeGen::CGCXXABI::emitBeginCatch ( CodeGenFunction CGF,
const CXXCatchStmt C 
)
pure virtual

◆ EmitCtorCompleteObjectHandler()

llvm::BasicBlock * CGCXXABI::EmitCtorCompleteObjectHandler ( CodeGenFunction CGF,
const CXXRecordDecl RD 
)
virtual

◆ EmitCXXConstructors()

virtual void clang::CodeGen::CGCXXABI::EmitCXXConstructors ( const CXXConstructorDecl D)
pure virtual

Emit constructor variants required by this ABI.

◆ EmitCXXDestructors()

virtual void clang::CodeGen::CGCXXABI::EmitCXXDestructors ( const CXXDestructorDecl D)
pure virtual

Emit destructor variants required by this ABI.

◆ emitCXXStructor()

virtual void clang::CodeGen::CGCXXABI::emitCXXStructor ( const CXXMethodDecl MD,
StructorType  Type 
)
pure virtual

Emit a single constructor/destructor with the given type from a C++ constructor Decl.

◆ EmitDestructorCall()

virtual void clang::CodeGen::CGCXXABI::EmitDestructorCall ( CodeGenFunction CGF,
const CXXDestructorDecl DD,
CXXDtorType  Type,
bool  ForVirtualBase,
bool  Delegating,
Address  This 
)
pure virtual

Emit the destructor call.

◆ EmitDynamicCastCall()

virtual llvm::Value* clang::CodeGen::CGCXXABI::EmitDynamicCastCall ( CodeGenFunction CGF,
Address  Value,
QualType  SrcRecordTy,
QualType  DestTy,
QualType  DestRecordTy,
llvm::BasicBlock *  CastEnd 
)
pure virtual

◆ EmitDynamicCastToVoid()

virtual llvm::Value* clang::CodeGen::CGCXXABI::EmitDynamicCastToVoid ( CodeGenFunction CGF,
Address  Value,
QualType  SrcRecordTy,
QualType  DestTy 
)
pure virtual

◆ EmitGuardedInit()

virtual void clang::CodeGen::CGCXXABI::EmitGuardedInit ( CodeGenFunction CGF,
const VarDecl D,
llvm::GlobalVariable *  DeclPtr,
bool  PerformInit 
)
pure virtual

Emits the guarded initializer and destructor setup for the given variable, given that it couldn't be emitted as a constant.

If PerformInit is false, the initialization has been folded to a constant and should not be performed.

The variable may be:

  • a static local variable
  • a static data member of a class template instantiation

Referenced by clang::CodeGen::CodeGenFunction::EmitCXXGuardedInit().

◆ EmitInstanceFunctionProlog()

virtual void clang::CodeGen::CGCXXABI::EmitInstanceFunctionProlog ( CodeGenFunction CGF)
pure virtual

Emit the ABI-specific prolog for the function.

Referenced by clang::CodeGen::CodeGenFunction::StartFunction(), and clang::CodeGen::CodeGenFunction::StartThunk().

◆ EmitLoadOfMemberFunctionPointer()

CGCallee CGCXXABI::EmitLoadOfMemberFunctionPointer ( CodeGenFunction CGF,
const Expr E,
Address  This,
llvm::Value *&  ThisPtrForCall,
llvm::Value MemPtr,
const MemberPointerType MPT 
)
virtual

Load a member function from an object and a member function pointer.

Apply the this-adjustment and set 'This' to the adjusted value.

Definition at line 47 of file CGCXXABI.cpp.

◆ EmitMemberDataPointer()

llvm::Constant * CGCXXABI::EmitMemberDataPointer ( const MemberPointerType MPT,
CharUnits  offset 
)
virtual

Create a member pointer for the given field.

Definition at line 114 of file CGCXXABI.cpp.

References GetBogusMemberPointer().

◆ EmitMemberDataPointerAddress()

llvm::Value * CGCXXABI::EmitMemberDataPointerAddress ( CodeGenFunction CGF,
const Expr E,
Address  Base,
llvm::Value MemPtr,
const MemberPointerType MPT 
)
virtual

Calculate an l-value from an object and a data member pointer.

Definition at line 65 of file CGCXXABI.cpp.

◆ EmitMemberFunctionPointer()

llvm::Constant * CGCXXABI::EmitMemberFunctionPointer ( const CXXMethodDecl MD)
virtual

◆ EmitMemberPointer()

llvm::Constant * CGCXXABI::EmitMemberPointer ( const APValue MP,
QualType  MPT 
)
virtual

Create a member pointer for the given member pointer constant.

Definition at line 119 of file CGCXXABI.cpp.

References GetBogusMemberPointer().

◆ EmitMemberPointerComparison()

llvm::Value * CGCXXABI::EmitMemberPointerComparison ( CodeGenFunction CGF,
llvm::Value L,
llvm::Value R,
const MemberPointerType MPT,
bool  Inequality 
)
virtual

Emit a comparison between two member pointers. Returns an i1.

Definition at line 87 of file CGCXXABI.cpp.

References clang::CodeGen::CodeGenFunction::Builder, and ErrorUnsupportedABI().

Referenced by GetIntrinsic().

◆ EmitMemberPointerConversion() [1/2]

llvm::Value * CGCXXABI::EmitMemberPointerConversion ( CodeGenFunction CGF,
const CastExpr E,
llvm::Value Src 
)
virtual

Perform a derived-to-base, base-to-derived, or bitcast member pointer conversion.

Definition at line 74 of file CGCXXABI.cpp.

Referenced by clang::CodeGen::CodeGenFunction::ShouldNullCheckClassCastValue().

◆ EmitMemberPointerConversion() [2/2]

llvm::Constant * CGCXXABI::EmitMemberPointerConversion ( const CastExpr E,
llvm::Constant *  Src 
)
virtual

Perform a derived-to-base, base-to-derived, or bitcast member pointer conversion on a constant value.

Definition at line 81 of file CGCXXABI.cpp.

◆ EmitMemberPointerIsNotNull()

llvm::Value * CGCXXABI::EmitMemberPointerIsNotNull ( CodeGenFunction CGF,
llvm::Value MemPtr,
const MemberPointerType MPT 
)
virtual

Determine if a member pointer is non-null. Returns an i1.

Definition at line 97 of file CGCXXABI.cpp.

References clang::CodeGen::CodeGenFunction::Builder, and ErrorUnsupportedABI().

Referenced by clang::CodeGen::CodeGenFunction::ShouldNullCheckClassCastValue().

◆ EmitNullMemberPointer()

llvm::Constant * CGCXXABI::EmitNullMemberPointer ( const MemberPointerType MPT)
virtual

Create a null member pointer of the given type.

Definition at line 105 of file CGCXXABI.cpp.

References GetBogusMemberPointer().

Referenced by clang::CodeGen::CodeGenFunction::ShouldNullCheckClassCastValue().

◆ emitRethrow()

virtual void clang::CodeGen::CGCXXABI::emitRethrow ( CodeGenFunction CGF,
bool  isNoReturn 
)
pure virtual

◆ EmitReturnFromThunk()

void CGCXXABI::EmitReturnFromThunk ( CodeGenFunction CGF,
RValue  RV,
QualType  ResultType 
)
virtual

◆ emitTerminateForUnexpectedException()

llvm::CallInst * CGCXXABI::emitTerminateForUnexpectedException ( CodeGenFunction CGF,
llvm::Value Exn 
)
virtual

◆ EmitThreadLocalInitFuncs()

virtual void clang::CodeGen::CGCXXABI::EmitThreadLocalInitFuncs ( CodeGenModule CGM,
ArrayRef< const VarDecl *>  CXXThreadLocals,
ArrayRef< llvm::Function *>  CXXThreadLocalInits,
ArrayRef< const VarDecl *>  CXXThreadLocalInitVars 
)
pure virtual

Emits ABI-required functions necessary to initialize thread_local variables in this translation unit.

Parameters
CXXThreadLocals- The thread_local declarations in this translation unit.
CXXThreadLocalInits- If this translation unit contains any non-constant initialization or non-trivial destruction for thread_local variables, a list of functions to perform the initialization.

◆ EmitThreadLocalVarDeclLValue()

virtual LValue clang::CodeGen::CGCXXABI::EmitThreadLocalVarDeclLValue ( CodeGenFunction CGF,
const VarDecl VD,
QualType  LValType 
)
pure virtual

Emit a reference to a non-local thread_local variable (including triggering the initialization of all thread_local variables in its translation unit).

◆ emitThrow()

virtual void clang::CodeGen::CGCXXABI::emitThrow ( CodeGenFunction CGF,
const CXXThrowExpr E 
)
pure virtual

◆ EmitTypeid()

virtual llvm::Value* clang::CodeGen::CGCXXABI::EmitTypeid ( CodeGenFunction CGF,
QualType  SrcRecordTy,
Address  ThisPtr,
llvm::Type StdTypeInfoPtrTy 
)
pure virtual

◆ EmitVirtualDestructorCall()

virtual llvm::Value* clang::CodeGen::CGCXXABI::EmitVirtualDestructorCall ( CodeGenFunction CGF,
const CXXDestructorDecl Dtor,
CXXDtorType  DtorType,
Address  This,
const CXXMemberCallExpr CE 
)
pure virtual

Emit the ABI-specific virtual destructor call.

◆ emitVirtualInheritanceTables()

virtual void clang::CodeGen::CGCXXABI::emitVirtualInheritanceTables ( const CXXRecordDecl RD)
pure virtual

Emit any tables needed to implement virtual inheritance.

For Itanium, this emits virtual table tables. For the MSVC++ ABI, this emits virtual base tables.

Referenced by clang::CodeGen::CodeGenVTables::GenerateClassData().

◆ emitVirtualObjectDelete()

virtual void clang::CodeGen::CGCXXABI::emitVirtualObjectDelete ( CodeGenFunction CGF,
const CXXDeleteExpr DE,
Address  Ptr,
QualType  ElementType,
const CXXDestructorDecl Dtor 
)
pure virtual

◆ emitVTableDefinitions()

virtual void clang::CodeGen::CGCXXABI::emitVTableDefinitions ( CodeGenVTables CGVT,
const CXXRecordDecl RD 
)
pure virtual

Emits the VTable definitions required for the given record type.

Referenced by clang::CodeGen::CodeGenVTables::GenerateClassData().

◆ ErrorUnsupportedABI()

void CGCXXABI::ErrorUnsupportedABI ( CodeGenFunction CGF,
StringRef  S 
)
protected

Issue a diagnostic about unsupported features in the ABI.

Definition at line 23 of file CGCXXABI.cpp.

Referenced by EmitCtorCompleteObjectHandler(), EmitMemberPointerComparison(), EmitMemberPointerIsNotNull(), InitializeArrayCookie(), and readArrayCookieImpl().

◆ getAddrOfCXXCatchHandlerType()

virtual CatchTypeInfo clang::CodeGen::CGCXXABI::getAddrOfCXXCatchHandlerType ( QualType  Ty,
QualType  CatchHandlerType 
)
pure virtual

◆ getAddrOfRTTIDescriptor()

virtual llvm::Constant* clang::CodeGen::CGCXXABI::getAddrOfRTTIDescriptor ( QualType  Ty)
pure virtual

◆ getAddrOfVTable()

virtual llvm::GlobalVariable* clang::CodeGen::CGCXXABI::getAddrOfVTable ( const CXXRecordDecl RD,
CharUnits  VPtrOffset 
)
pure virtual

Get the address of the vtable for the given record decl which should be used for the vptr at the given offset in RD.

Referenced by BuildAppleKextVirtualCall(), and GetAddrOfVTTVTable().

◆ GetArrayCookieSize()

CharUnits CGCXXABI::GetArrayCookieSize ( const CXXNewExpr expr)
virtual

Returns the extra size required in order to store the array cookie for the given new-expression.

May return 0 to indicate that no array cookie is required.

Several cases are filtered out before this method is called:

  • non-array allocations never need a cookie
  • calls to ::operator new(size_t, void*) never need a cookie
Parameters
expr- the new-expression being allocated.

Definition at line 168 of file CGCXXABI.cpp.

References clang::CXXNewExpr::getAllocatedType(), getArrayCookieSizeImpl(), requiresArrayCookie(), and clang::CharUnits::Zero().

◆ getArrayCookieSizeImpl()

CharUnits CGCXXABI::getArrayCookieSizeImpl ( QualType  elementType)
protectedvirtual

Returns the extra size required in order to store the array cookie for the given type.

Assumes that an array cookie is required.

Definition at line 174 of file CGCXXABI.cpp.

References clang::CharUnits::Zero().

Referenced by GetArrayCookieSize(), and ReadArrayCookie().

◆ GetBogusMemberPointer()

llvm::Constant * CGCXXABI::GetBogusMemberPointer ( QualType  T)
protected

◆ getCatchAllTypeInfo()

CatchTypeInfo CGCXXABI::getCatchAllTypeInfo ( )
virtual

Definition at line 301 of file CGCXXABI.cpp.

◆ getContext()

ASTContext& clang::CodeGen::CGCXXABI::getContext ( ) const
inlineprotected

Definition at line 81 of file CGCXXABI.h.

References clang::CodeGen::CodeGenModule::getContext().

◆ GetDeletedVirtualCallName()

virtual StringRef clang::CodeGen::CGCXXABI::GetDeletedVirtualCallName ( )
pure virtual

Gets the deleted virtual member call name.

Referenced by clang::CodeGen::CodeGenVTables::EmitThunks().

◆ getMangleContext()

MangleContext& clang::CodeGen::CGCXXABI::getMangleContext ( )
inline

◆ getMemberPointerAdjustment()

llvm::Constant * CGCXXABI::getMemberPointerAdjustment ( const CastExpr E)
protected

A utility method for computing the offset required for the given base-to-derived or derived-to-base member-pointer conversion.

Returns the adjustment, in bytes, required for the given member-pointer operation.

Does not handle virtual conversions (in case we ever fully support an ABI that allows this). Returns null if no adjustment is required.

Returns null if no adjustment is required.

Definition at line 240 of file CGCXXABI.cpp.

◆ getMemberPointerPathAdjustment()

CharUnits CGCXXABI::getMemberPointerPathAdjustment ( const APValue MP)
protected

Computes the non-virtual adjustment needed for a member pointer conversion along an inheritance path stored in an APValue.

Unlike getMemberPointerAdjustment(), the adjustment can be negative if the path is from a derived type to a base type.

Definition at line 258 of file CGCXXABI.cpp.

References clang::Decl::getDeclContext(), clang::APValue::getMemberPointerDecl(), clang::APValue::getMemberPointerPath(), clang::APValue::isMemberPointerToDerivedMember(), and clang::CharUnits::Zero().

◆ GetPureVirtualCallName()

virtual StringRef clang::CodeGen::CGCXXABI::GetPureVirtualCallName ( )
pure virtual

Gets the pure virtual member call function.

Referenced by clang::CodeGen::CodeGenVTables::EmitThunks().

◆ getRecordArgABI()

virtual RecordArgABI clang::CodeGen::CGCXXABI::getRecordArgABI ( const CXXRecordDecl RD) const
pure virtual

Returns how an argument of the given record type should be passed.

Referenced by getRecordArgABI(), and isInAllocaArgument().

◆ getSrcArgforCopyCtor()

virtual size_t clang::CodeGen::CGCXXABI::getSrcArgforCopyCtor ( const CXXConstructorDecl ,
FunctionArgList Args 
) const
pure virtual

◆ getStructorImplicitParamDecl()

ImplicitParamDecl*& clang::CodeGen::CGCXXABI::getStructorImplicitParamDecl ( CodeGenFunction CGF)
inlineprotected

Definition at line 69 of file CGCXXABI.h.

◆ getStructorImplicitParamValue()

llvm::Value*& clang::CodeGen::CGCXXABI::getStructorImplicitParamValue ( CodeGenFunction CGF)
inlineprotected

Definition at line 72 of file CGCXXABI.h.

◆ getThisAddress()

Address clang::CodeGen::CGCXXABI::getThisAddress ( CodeGenFunction CGF)
inlineprotected

Definition at line 59 of file CGCXXABI.h.

◆ getThisArgumentTypeForMethod()

virtual const CXXRecordDecl* clang::CodeGen::CGCXXABI::getThisArgumentTypeForMethod ( const CXXMethodDecl MD)
inlinevirtual

Get the type of the implicit "this" parameter used by a method.

May return zero if no specific type is applicable, e.g. if the ABI expects the "this" parameter to point to some artificial offset in a complete object due to vbases being reordered.

Definition at line 330 of file CGCXXABI.h.

References clang::CXXMethodDecl::getParent().

Referenced by clang::CodeGen::CodeGenTypes::arrangeCXXMethodDeclaration(), and commonEmitCXXMemberOrOperatorCall().

◆ getThisDecl()

ImplicitParamDecl* clang::CodeGen::CGCXXABI::getThisDecl ( CodeGenFunction CGF)
inlineprotected

Definition at line 53 of file CGCXXABI.h.

Referenced by loadIncomingCXXThis(), and setCXXABIThisValue().

◆ getThisValue()

llvm::Value* clang::CodeGen::CGCXXABI::getThisValue ( CodeGenFunction CGF)
inlineprotected

Definition at line 56 of file CGCXXABI.h.

◆ getThrowInfo()

virtual llvm::GlobalVariable* clang::CodeGen::CGCXXABI::getThrowInfo ( QualType  T)
inlinevirtual

Definition at line 238 of file CGCXXABI.h.

◆ getVBPtrOffsets()

std::vector< CharUnits > CGCXXABI::getVBPtrOffsets ( const CXXRecordDecl RD)
virtual

Gets the offsets of all the virtual base pointers in a given class.

Definition at line 305 of file CGCXXABI.cpp.

Referenced by EmitNullBaseClassInitialization().

◆ GetVirtualBaseClassOffset()

virtual llvm::Value* clang::CodeGen::CGCXXABI::GetVirtualBaseClassOffset ( CodeGenFunction CGF,
Address  This,
const CXXRecordDecl ClassDecl,
const CXXRecordDecl BaseClassDecl 
)
pure virtual

◆ getVirtualFunctionPointer()

virtual CGCallee clang::CodeGen::CGCXXABI::getVirtualFunctionPointer ( CodeGenFunction CGF,
GlobalDecl  GD,
Address  This,
llvm::Type Ty,
SourceLocation  Loc 
)
pure virtual

Build a virtual function pointer in the ABI-specific way.

◆ getVirtualFunctionPrologueThisAdjustment()

virtual CharUnits clang::CodeGen::CGCXXABI::getVirtualFunctionPrologueThisAdjustment ( GlobalDecl  GD)
inlinevirtual

Get the ABI-specific "this" parameter adjustment to apply in the prologue of a virtual function.

Definition at line 358 of file CGCXXABI.h.

◆ getVTableAddressPoint()

virtual llvm::Constant* clang::CodeGen::CGCXXABI::getVTableAddressPoint ( BaseSubobject  Base,
const CXXRecordDecl VTableClass 
)
pure virtual

Get the address point of the vtable for the given base subobject.

◆ getVTableAddressPointForConstExpr()

virtual llvm::Constant* clang::CodeGen::CGCXXABI::getVTableAddressPointForConstExpr ( BaseSubobject  Base,
const CXXRecordDecl VTableClass 
)
pure virtual

Get the address point of the vtable for the given base subobject while building a constexpr.

◆ getVTableAddressPointInStructor()

virtual llvm::Value* clang::CodeGen::CGCXXABI::getVTableAddressPointInStructor ( CodeGenFunction CGF,
const CXXRecordDecl RD,
BaseSubobject  Base,
const CXXRecordDecl NearestVBase 
)
pure virtual

Get the address point of the vtable for the given base subobject while building a constructor or a destructor.

◆ hasMostDerivedReturn()

virtual bool clang::CodeGen::CGCXXABI::hasMostDerivedReturn ( GlobalDecl  GD) const
inlinevirtual

◆ HasThisReturn()

virtual bool clang::CodeGen::CGCXXABI::HasThisReturn ( GlobalDecl  GD) const
inlinevirtual

Returns true if the given constructor or destructor is one of the kinds that the ABI says returns 'this' (only applies when called non-virtually for destructors).

There currently is no way to indicate if a destructor returns 'this' when called virtually, and code generation does not support the case.

Definition at line 107 of file CGCXXABI.h.

Referenced by clang::CodeGen::CodeGenTypes::arrangeCXXConstructorCall(), clang::CodeGen::CodeGenTypes::arrangeCXXStructorDeclaration(), clang::CodeGen::CodeGenFunction::BuildFunctionArgList(), clang::CodeGen::CodeGenFunction::EmitCallAndReturnForThunk(), EmitDeclDestroy(), and clang::CodeGen::CodeGenFunction::StartThunk().

◆ InitializeArrayCookie()

Address CGCXXABI::InitializeArrayCookie ( CodeGenFunction CGF,
Address  NewPtr,
llvm::Value NumElements,
const CXXNewExpr expr,
QualType  ElementType 
)
virtual

Initialize the array cookie for the given allocation.

Parameters
NewPtr- a char* which is the presumed-non-null return value of the allocation function
NumElements- the computed number of elements, potentially collapsed from the multidimensional array case; always a size_t
ElementType- the base element allocated type, i.e. the allocated type after stripping all array types

Definition at line 179 of file CGCXXABI.cpp.

References ErrorUnsupportedABI(), and clang::CodeGen::Address::invalid().

◆ initializeHiddenVirtualInheritanceMembers()

virtual void clang::CodeGen::CGCXXABI::initializeHiddenVirtualInheritanceMembers ( CodeGenFunction CGF,
const CXXRecordDecl RD 
)
inlinevirtual

Emit the code to initialize hidden members required to handle virtual inheritance, if needed by the ABI.

Definition at line 289 of file CGCXXABI.h.

◆ isMemberPointerConvertible()

virtual bool clang::CodeGen::CGCXXABI::isMemberPointerConvertible ( const MemberPointerType MPT) const
inlinevirtual

Return whether or not a member pointers type is convertible to an IR type.

Definition at line 186 of file CGCXXABI.h.

Referenced by clang::CodeGen::CodeGenTypes::ConvertType(), and clang::CodeGen::CodeGenTypes::isFuncParamTypeConvertible().

◆ isSRetParameterAfterThis()

virtual bool clang::CodeGen::CGCXXABI::isSRetParameterAfterThis ( ) const
inlinevirtual

Returns true if the implicit 'sret' parameter comes after the implicit 'this' parameter of C++ instance methods.

Definition at line 149 of file CGCXXABI.h.

◆ isThisCompleteObject()

virtual bool clang::CodeGen::CGCXXABI::isThisCompleteObject ( GlobalDecl  GD) const
protectedpure virtual

Determine whether there's something special about the rules of the ABI tell us that 'this' is a complete object within the given function.

Obvious common logic like being defined on a final class will have been taken care of by the caller.

Referenced by buildThisParam().

◆ isVirtualOffsetNeededForVTableField()

virtual bool clang::CodeGen::CGCXXABI::isVirtualOffsetNeededForVTableField ( CodeGenFunction CGF,
CodeGenFunction::VPtr  Vptr 
)
pure virtual

Checks if ABI requires extra virtual offset for vtable field.

◆ isZeroInitializable()

bool CGCXXABI::isZeroInitializable ( const MemberPointerType MPT)
virtual

Return true if the given member pointer can be zero-initialized (in the C++ sense) with an LLVM zeroinitializer.

Definition at line 123 of file CGCXXABI.cpp.

Referenced by clang::CodeGen::CodeGenTypes::isZeroInitializable().

◆ loadIncomingCXXThis()

llvm::Value * CGCXXABI::loadIncomingCXXThis ( CodeGenFunction CGF)
protected

Loads the incoming C++ this pointer as it was passed by the caller.

Definition at line 152 of file CGCXXABI.cpp.

References clang::CodeGen::CodeGenFunction::Builder, clang::CodeGen::CGBuilderTy::CreateLoad(), clang::CodeGen::CodeGenFunction::GetAddrOfLocalVar(), and getThisDecl().

◆ NeedsVTTParameter()

bool CGCXXABI::NeedsVTTParameter ( GlobalDecl  GD)
virtual

Return whether the given global decl needs a VTT parameter.

Definition at line 290 of file CGCXXABI.cpp.

◆ performReturnAdjustment()

virtual llvm::Value* clang::CodeGen::CGCXXABI::performReturnAdjustment ( CodeGenFunction CGF,
Address  Ret,
const ReturnAdjustment RA 
)
pure virtual

Referenced by PerformReturnAdjustment().

◆ performThisAdjustment()

virtual llvm::Value* clang::CodeGen::CGCXXABI::performThisAdjustment ( CodeGenFunction CGF,
Address  This,
const ThisAdjustment TA 
)
pure virtual

◆ ReadArrayCookie()

void CGCXXABI::ReadArrayCookie ( CodeGenFunction CGF,
Address  Ptr,
const CXXDeleteExpr expr,
QualType  ElementType,
llvm::Value *&  NumElements,
llvm::Value *&  AllocPtr,
CharUnits CookieSize 
)
virtual

Reads the array cookie associated with the given pointer, if it has one.

Parameters
Ptr- a pointer to the first element in the array
ElementType- the base element type of elements of the array
NumElements- an out parameter which will be initialized with the number of elements allocated, or zero if there is no cookie
AllocPtr- an out parameter which will be initialized with a char* pointing to the address returned by the allocation function
CookieSize- an out parameter which will be initialized with the size of the cookie, or zero if there is no cookie

Definition at line 208 of file CGCXXABI.cpp.

References clang::CodeGen::CodeGenFunction::Builder, clang::CodeGen::CGBuilderTy::CreateConstInBoundsByteGEP(), clang::CodeGen::CGBuilderTy::CreateElementBitCast(), getArrayCookieSizeImpl(), clang::CodeGen::Address::getPointer(), clang::CodeGen::CodeGenTypeCache::Int8Ty, readArrayCookieImpl(), requiresArrayCookie(), and clang::CharUnits::Zero().

◆ readArrayCookieImpl()

llvm::Value * CGCXXABI::readArrayCookieImpl ( CodeGenFunction IGF,
Address  ptr,
CharUnits  cookieSize 
)
protectedvirtual

Reads the array cookie for an allocation which is known to have one.

This is called by the standard implementation of ReadArrayCookie.

Parameters
ptr- a pointer to the allocation made for an array, as a char*
cookieSize- the computed cookie size of an array

Other parameters are as above.

Returns
a size_t

Definition at line 230 of file CGCXXABI.cpp.

References ErrorUnsupportedABI(), and clang::CodeGen::CodeGenTypeCache::SizeTy.

Referenced by ReadArrayCookie().

◆ registerGlobalDtor()

virtual void clang::CodeGen::CGCXXABI::registerGlobalDtor ( CodeGenFunction CGF,
const VarDecl D,
llvm::Constant *  Dtor,
llvm::Constant *  Addr 
)
pure virtual

Emit code to force the execution of a destructor during global teardown.

The default implementation of this uses atexit.

Parameters
Dtor- a function taking a single pointer argument
Addr- a pointer to pass to the destructor function.

Referenced by clang::CodeGen::createOffloadingBinaryDescriptorRegistration(), and EmitDeclDestroy().

◆ requiresArrayCookie() [1/2]

bool CGCXXABI::requiresArrayCookie ( const CXXDeleteExpr E,
QualType  eltType 
)
protectedvirtual

◆ requiresArrayCookie() [2/2]

bool CGCXXABI::requiresArrayCookie ( const CXXNewExpr E)
protectedvirtual

◆ setCXXABIThisValue()

void CGCXXABI::setCXXABIThisValue ( CodeGenFunction CGF,
llvm::Value ThisPtr 
)
protected

Initialize the 'this' slot.

Definition at line 157 of file CGCXXABI.cpp.

References getThisDecl().

◆ setThunkLinkage()

virtual void clang::CodeGen::CGCXXABI::setThunkLinkage ( llvm::Function *  Thunk,
bool  ForVTable,
GlobalDecl  GD,
bool  ReturnAdjustment 
)
pure virtual

Referenced by setThunkProperties().

◆ shouldDynamicCastCallBeNullChecked()

virtual bool clang::CodeGen::CGCXXABI::shouldDynamicCastCallBeNullChecked ( bool  SrcIsPtr,
QualType  SrcRecordTy 
)
pure virtual

◆ shouldTypeidBeNullChecked()

virtual bool clang::CodeGen::CGCXXABI::shouldTypeidBeNullChecked ( bool  IsDeref,
QualType  SrcRecordTy 
)
pure virtual

◆ usesThreadWrapperFunction()

virtual bool clang::CodeGen::CGCXXABI::usesThreadWrapperFunction ( ) const
pure virtual

◆ useThunkForDtorVariant()

virtual bool clang::CodeGen::CGCXXABI::useThunkForDtorVariant ( const CXXDestructorDecl Dtor,
CXXDtorType  DT 
) const
pure virtual

Returns true if the given destructor type should be emitted as a linkonce delegating thunk, regardless of whether the dtor is defined in this TU or not.

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

Member Data Documentation

◆ CGM

CodeGenModule& clang::CodeGen::CGCXXABI::CGM
protected

◆ MangleCtx

std::unique_ptr<MangleContext> clang::CodeGen::CGCXXABI::MangleCtx
protected

Definition at line 47 of file CGCXXABI.h.


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