clang 20.0.0git
Classes | Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
clang::CodeGen::CGCXXABI Class Referenceabstract

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

#include "/home/buildbot/as-worker-4/publish-doxygen-docs/llvm-project/clang/lib/CodeGen/CGCXXABI.h"

Classes

struct  AddedStructorArgCounts
 Similar to AddedStructorArgs, but only notes the number of additional arguments. More...
 
struct  AddedStructorArgs
 Additional implicit arguments to add to the beginning (Prefix) and end (Suffix) of a constructor / destructor 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...
 
using DeleteOrMemberCallExpr = llvm::PointerUnion< const CXXDeleteExpr *, const CXXMemberCallExpr * >
 

Public Member Functions

virtual ~CGCXXABI ()
 
MangleContextgetMangleContext ()
 Gets the mangle context.
 
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).
 
virtual bool hasMostDerivedReturn (GlobalDecl GD) const
 
virtual bool useSinitAndSterm () 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).
 
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.
 
virtual RecordArgABI getRecordArgABI (const CXXRecordDecl *RD) const =0
 Returns how an argument of the given record type should be passed.
 
virtual bool isSRetParameterAfterThis () const
 Returns true if the implicit 'sret' parameter comes after the implicit 'this' parameter of C++ instance methods.
 
virtual bool isPermittedToBeHomogeneousAggregate (const CXXRecordDecl *RD) const
 Returns true if the ABI permits the argument to be a homogeneous aggregate.
 
virtual llvm::Type * ConvertMemberPointerType (const MemberPointerType *MPT)
 Find the LLVM type used to represent the given member pointer type.
 
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.
 
virtual llvm::Value * EmitMemberDataPointerAddress (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.
 
virtual llvm::Value * EmitMemberPointerConversion (CodeGenFunction &CGF, const CastExpr *E, llvm::Value *Src)
 Perform a derived-to-base, base-to-derived, or bitcast member pointer conversion.
 
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.
 
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.
 
virtual bool isMemberPointerConvertible (const MemberPointerType *MPT) const
 Return whether or not a member pointers type is convertible to an IR type.
 
virtual llvm::Constant * EmitNullMemberPointer (const MemberPointerType *MPT)
 Create a null member pointer of the given type.
 
virtual llvm::Constant * EmitMemberFunctionPointer (const CXXMethodDecl *MD)
 Create a member pointer for the given method.
 
virtual llvm::Constant * EmitMemberDataPointer (const MemberPointerType *MPT, CharUnits offset)
 Create a member pointer for the given field.
 
virtual llvm::Constant * EmitMemberPointer (const APValue &MP, QualType MPT)
 Create a member pointer for the given member pointer constant.
 
virtual llvm::Value * EmitMemberPointerComparison (CodeGenFunction &CGF, llvm::Value *L, llvm::Value *R, const MemberPointerType *MPT, bool Inequality)
 Emit a comparison between two member pointers. Returns an i1.
 
virtual llvm::Value * EmitMemberPointerIsNotNull (CodeGenFunction &CGF, llvm::Value *MemPtr, const MemberPointerType *MPT)
 Determine if a member pointer is non-null. Returns an i1.
 
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.
 
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 (QualType SrcRecordTy)=0
 
virtual void EmitBadTypeidCall (CodeGenFunction &CGF)=0
 
virtual llvm::Value * EmitTypeid (CodeGenFunction &CGF, QualType SrcRecordTy, Address ThisPtr, llvm::Type *StdTypeInfoPtrTy)=0
 
virtual bool shouldDynamicCastCallBeNullChecked (bool SrcIsPtr, QualType SrcRecordTy)=0
 
virtual bool shouldEmitExactDynamicCast (QualType DestRecordTy)=0
 
virtual llvm::Value * emitDynamicCastCall (CodeGenFunction &CGF, Address Value, QualType SrcRecordTy, QualType DestTy, QualType DestRecordTy, llvm::BasicBlock *CastEnd)=0
 
virtual llvm::Value * emitDynamicCastToVoid (CodeGenFunction &CGF, Address Value, QualType SrcRecordTy)=0
 
virtual llvm::Value * emitExactDynamicCast (CodeGenFunction &CGF, Address Value, QualType SrcRecordTy, QualType DestTy, QualType DestRecordTy, llvm::BasicBlock *CastSuccess, llvm::BasicBlock *CastFail)=0
 Emit a dynamic_cast from SrcRecordTy to DestRecordTy.
 
virtual bool EmitBadCastCall (CodeGenFunction &CGF)=0
 
virtual llvm::Value * GetVirtualBaseClassOffset (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.
 
virtual void EmitCXXConstructors (const CXXConstructorDecl *D)=0
 Emit constructor variants required by this ABI.
 
virtual AddedStructorArgCounts buildStructorSignature (GlobalDecl GD, SmallVectorImpl< CanQualType > &ArgTys)=0
 Build the signature of the given constructor or destructor variant by adding any required parameters.
 
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.
 
virtual void setCXXDestructorDLLStorage (llvm::GlobalValue *GV, const CXXDestructorDecl *Dtor, CXXDtorType DT) const
 
virtual llvm::GlobalValue::LinkageTypes getCXXDestructorLinkage (GVALinkage Linkage, const CXXDestructorDecl *Dtor, CXXDtorType DT) const
 
virtual void EmitCXXDestructors (const CXXDestructorDecl *D)=0
 Emit destructor variants required by this ABI.
 
virtual const CXXRecordDeclgetThisArgumentTypeForMethod (GlobalDecl GD)
 Get the type of the implicit "this" parameter used by a method.
 
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.
 
void buildThisParam (CodeGenFunction &CGF, FunctionArgList &Params)
 Build a parameter variable suitable for 'this'.
 
virtual void addImplicitStructorParams (CodeGenFunction &CGF, QualType &ResTy, FunctionArgList &Params)=0
 Insert any ABI-specific implicit parameters into the parameter list for a function.
 
virtual CharUnits getVirtualFunctionPrologueThisAdjustment (GlobalDecl GD)
 Get the ABI-specific "this" parameter adjustment to apply in the prologue of a virtual function.
 
virtual void EmitInstanceFunctionProlog (CodeGenFunction &CGF)=0
 Emit the ABI-specific prolog for the function.
 
virtual AddedStructorArgs getImplicitConstructorArgs (CodeGenFunction &CGF, const CXXConstructorDecl *D, CXXCtorType Type, bool ForVirtualBase, bool Delegating)=0
 
AddedStructorArgCounts addImplicitConstructorArgs (CodeGenFunction &CGF, const CXXConstructorDecl *D, CXXCtorType Type, bool ForVirtualBase, bool Delegating, CallArgList &Args)
 Add any ABI-specific implicit arguments needed to call a constructor.
 
virtual llvm::Value * getCXXDestructorImplicitParam (CodeGenFunction &CGF, const CXXDestructorDecl *DD, CXXDtorType Type, bool ForVirtualBase, bool Delegating)=0
 Get the implicit (second) parameter that comes after the "this" pointer, or nullptr if there is isn't one.
 
virtual void EmitDestructorCall (CodeGenFunction &CGF, const CXXDestructorDecl *DD, CXXDtorType Type, bool ForVirtualBase, bool Delegating, Address This, QualType ThisTy)=0
 Emit the destructor call.
 
virtual void emitVTableDefinitions (CodeGenVTables &CGVT, const CXXRecordDecl *RD)=0
 Emits the VTable definitions required for the given record type.
 
virtual bool isVirtualOffsetNeededForVTableField (CodeGenFunction &CGF, CodeGenFunction::VPtr Vptr)=0
 Checks if ABI requires extra virtual offset for vtable field.
 
virtual bool doStructorsInitializeVPtrs (const CXXRecordDecl *VTableClass)=0
 Checks if ABI requires to initialize vptrs for given dynamic class.
 
virtual llvm::Constant * getVTableAddressPoint (BaseSubobject Base, const CXXRecordDecl *VTableClass)=0
 Get the address point of the vtable for the given base subobject.
 
virtual llvm::Value * getVTableAddressPointInStructor (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.
 
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.
 
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.
 
virtual llvm::Value * EmitVirtualDestructorCall (CodeGenFunction &CGF, const CXXDestructorDecl *Dtor, CXXDtorType DtorType, Address This, DeleteOrMemberCallExpr E)=0
 Emit the ABI-specific virtual destructor call.
 
virtual void adjustCallArgsForDestructorThunk (CodeGenFunction &CGF, GlobalDecl GD, CallArgList &CallArgs)
 
virtual void emitVirtualInheritanceTables (const CXXRecordDecl *RD)=0
 Emit any tables needed to implement virtual inheritance.
 
virtual bool exportThunk ()=0
 
virtual void setThunkLinkage (llvm::Function *Thunk, bool ForVTable, GlobalDecl GD, bool ReturnAdjustment)=0
 
virtual llvm::Value * performThisAdjustment (CodeGenFunction &CGF, Address This, const CXXRecordDecl *UnadjustedClass, const ThunkInfo &TI)=0
 
virtual llvm::Value * performReturnAdjustment (CodeGenFunction &CGF, Address Ret, const CXXRecordDecl *UnadjustedClass, 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.
 
virtual StringRef GetPureVirtualCallName ()=0
 Gets the pure virtual member call function.
 
virtual StringRef GetDeletedVirtualCallName ()=0
 Gets the deleted virtual member call name.
 
virtual CharUnits GetArrayCookieSize (const CXXNewExpr *expr)
 Returns the extra size required in order to store the array cookie for the given new-expression.
 
virtual Address InitializeArrayCookie (CodeGenFunction &CGF, Address NewPtr, llvm::Value *NumElements, const CXXNewExpr *expr, QualType ElementType)
 Initialize the array cookie for the given allocation.
 
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.
 
virtual bool NeedsVTTParameter (GlobalDecl GD)
 Return whether the given global decl needs a VTT parameter.
 
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.
 
virtual void registerGlobalDtor (CodeGenFunction &CGF, const VarDecl &D, llvm::FunctionCallee Dtor, llvm::Constant *Addr)=0
 Emit code to force the execution of a destructor during global teardown.
 
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.
 
virtual bool usesThreadWrapperFunction (const VarDecl *VD) 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).
 
virtual void emitCXXStructor (GlobalDecl GD)=0
 Emit a single constructor/destructor with the given type from a C++ constructor Decl.
 
virtual std::pair< llvm::Value *, const CXXRecordDecl * > LoadVTablePtr (CodeGenFunction &CGF, Address This, const CXXRecordDecl *RD)=0
 Load a vtable from This, an object of polymorphic type RD, or from one of its virtual bases if it does not have its own vtable.
 

Protected Member Functions

 CGCXXABI (CodeGenModule &CGM)
 
ImplicitParamDeclgetThisDecl (CodeGenFunction &CGF)
 
llvm::Value * getThisValue (CodeGenFunction &CGF)
 
Address getThisAddress (CodeGenFunction &CGF)
 
void ErrorUnsupportedABI (CodeGenFunction &CGF, StringRef S)
 Issue a diagnostic about unsupported features in the ABI.
 
llvm::Constant * GetBogusMemberPointer (QualType T)
 Get a null value for unsupported member pointers.
 
ImplicitParamDecl *& getStructorImplicitParamDecl (CodeGenFunction &CGF)
 
llvm::Value *& getStructorImplicitParamValue (CodeGenFunction &CGF)
 
llvm::Value * loadIncomingCXXThis (CodeGenFunction &CGF)
 Loads the incoming C++ this pointer as it was passed by the caller.
 
void setCXXABIThisValue (CodeGenFunction &CGF, llvm::Value *ThisPtr)
 
ASTContextgetContext () const
 
bool mayNeedDestruction (const VarDecl *VD) const
 
bool isEmittedWithConstantInitializer (const VarDecl *VD, bool InspectInitForWeakDef=false) const
 Determine whether we will definitely emit this variable with a constant initializer, either because the language semantics demand it or because we know that the initializer is a constant.
 
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.
 
virtual bool constructorsAndDestructorsReturnThis () const
 
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.
 
virtual CharUnits getArrayCookieSizeImpl (QualType elementType)
 Returns the extra size required in order to store the array cookie for the given type.
 
virtual llvm::Value * readArrayCookieImpl (CodeGenFunction &IGF, Address ptr, CharUnits cookieSize)
 Reads the array cookie for an allocation which is known to have one.
 

Protected Attributes

CodeGenModuleCGM
 
std::unique_ptr< MangleContextMangleCtx
 

Friends

class CodeGenModule
 

Detailed Description

Implements C++ ABI-specific code generation functions.

Definition at line 43 of file CGCXXABI.h.

Member Typedef Documentation

◆ DeleteOrMemberCallExpr

Definition at line 484 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 150 of file CGCXXABI.h.

Constructor & Destructor Documentation

◆ CGCXXABI()

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

Definition at line 50 of file CGCXXABI.h.

◆ ~CGCXXABI()

CGCXXABI::~CGCXXABI ( )
virtual

Definition at line 21 of file CGCXXABI.cpp.

Member Function Documentation

◆ addImplicitConstructorArgs()

CGCXXABI::AddedStructorArgCounts CGCXXABI::addImplicitConstructorArgs ( CodeGenFunction CGF,
const CXXConstructorDecl D,
CXXCtorType  Type,
bool  ForVirtualBase,
bool  Delegating,
CallArgList Args 
)

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.

Definition at line 346 of file CGCXXABI.cpp.

References clang::CodeGen::CallArgList::add(), D, clang::Delegating, clang::CodeGen::RValue::get(), getImplicitConstructorArgs(), clang::CodeGen::CGCXXABI::AddedStructorArgs::Prefix, and clang::CodeGen::CGCXXABI::AddedStructorArgs::Suffix.

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

◆ adjustCallArgsForDestructorThunk()

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

Definition at line 494 of file CGCXXABI.h.

◆ 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 395 of file CGCXXABI.h.

◆ buildStructorSignature()

virtual AddedStructorArgCounts clang::CodeGen::CGCXXABI::buildStructorSignature ( GlobalDecl  GD,
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 143 of file CGCXXABI.h.

Referenced by EmitDeclDestroy().

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

◆ constructorsAndDestructorsReturnThis()

virtual bool clang::CodeGen::CGCXXABI::constructorsAndDestructorsReturnThis ( ) const
inlineprotectedvirtual

Definition at line 104 of file CGCXXABI.h.

References CGM, and clang::CodeGen::CodeGenModule::getCodeGenOpts().

Referenced by HasThisReturn().

◆ 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

Referenced by EmitTypeidFromVTable().

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

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

◆ EmitCXXDestructors()

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

Emit destructor variants required by this ABI.

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

◆ emitCXXStructor()

virtual void clang::CodeGen::CGCXXABI::emitCXXStructor ( GlobalDecl  GD)
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,
QualType  ThisTy 
)
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 
)
pure virtual

◆ emitExactDynamicCast()

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

Emit a dynamic_cast from SrcRecordTy to DestRecordTy.

The cast fails if the dynamic type of Value is not exactly DestRecordTy.

◆ 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

◆ EmitInstanceFunctionProlog()

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

Emit the ABI-specific prolog for the function.

◆ EmitLoadOfMemberFunctionPointer()

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

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

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

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

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

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

Referenced by clang::CodeGen::ConstantEmitter::tryEmitPrivate().

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

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

References E, ErrorUnsupportedABI(), GetBogusMemberPointer(), and clang::Expr::getType().

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

References E, GetBogusMemberPointer(), and clang::Expr::getType().

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

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

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

Referenced by EmitGlobalVarDeclLValue().

◆ 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

Referenced by EmitTypeidFromVTable().

◆ EmitVirtualDestructorCall()

virtual llvm::Value * clang::CodeGen::CGCXXABI::EmitVirtualDestructorCall ( CodeGenFunction CGF,
const CXXDestructorDecl Dtor,
CXXDtorType  DtorType,
Address  This,
DeleteOrMemberCallExpr  E 
)
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

◆ exportThunk()

virtual bool clang::CodeGen::CGCXXABI::exportThunk ( )
pure virtual

Referenced by setThunkProperties().

◆ 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(), clang::CodeGen::CodeGenVTables::GetAddrOfVTT(), 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 215 of file CGCXXABI.cpp.

References clang::ast_matchers::expr, getArrayCookieSizeImpl(), requiresArrayCookie(), and clang::CharUnits::Zero().

Referenced by CalculateCookiePadding().

◆ 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 221 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 338 of file CGCXXABI.cpp.

◆ getContext()

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

◆ getCXXDestructorImplicitParam()

virtual llvm::Value * clang::CodeGen::CGCXXABI::getCXXDestructorImplicitParam ( CodeGenFunction CGF,
const CXXDestructorDecl DD,
CXXDtorType  Type,
bool  ForVirtualBase,
bool  Delegating 
)
pure virtual

Get the implicit (second) parameter that comes after the "this" pointer, or nullptr if there is isn't one.

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

◆ getCXXDestructorLinkage()

llvm::GlobalValue::LinkageTypes CGCXXABI::getCXXDestructorLinkage ( GVALinkage  Linkage,
const CXXDestructorDecl Dtor,
CXXDtorType  DT 
) const
virtual

◆ GetDeletedVirtualCallName()

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

Gets the deleted virtual member call name.

◆ getImplicitConstructorArgs()

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

◆ 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 286 of file CGCXXABI.cpp.

References clang::Type::castAs(), CGM, E, clang::Type::getAsCXXRecordDecl(), clang::CodeGen::CodeGenModule::GetNonVirtualBaseClassOffset(), and clang::Expr::getType().

◆ GetPureVirtualCallName()

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

Gets the pure virtual member call function.

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

◆ getSrcArgforCopyCtor()

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

Referenced by EmitMemberInitializer().

◆ 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 CGCXXABI::getThisAddress ( CodeGenFunction CGF)
protected

◆ getThisArgumentTypeForMethod()

virtual const CXXRecordDecl * clang::CodeGen::CGCXXABI::getThisArgumentTypeForMethod ( GlobalDecl  GD)
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 387 of file CGCXXABI.h.

References clang::GlobalDecl::getDecl(), and clang::DeclContext::getParent().

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

◆ getThisDecl()

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

Definition at line 54 of file CGCXXABI.h.

Referenced by loadIncomingCXXThis(), and setCXXABIThisValue().

◆ getThisValue()

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

Definition at line 57 of file CGCXXABI.h.

◆ getThrowInfo()

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

Definition at line 259 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 342 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.

Referenced by clang::CodeGen::CGCallee::prepareConcreteCallee().

◆ 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 415 of file CGCXXABI.h.

References clang::CharUnits::Zero().

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

◆ 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 123 of file CGCXXABI.h.

References constructorsAndDestructorsReturnThis(), clang::Dtor_Deleting, clang::GlobalDecl::getDecl(), and clang::GlobalDecl::getDtorType().

Referenced by clang::CodeGen::CodeGenTypes::arrangeCXXConstructorCall(), clang::CodeGen::CodeGenTypes::arrangeCXXStructorDeclaration(), and EmitDeclDestroy().

◆ 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 226 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 319 of file CGCXXABI.h.

◆ isEmittedWithConstantInitializer()

bool CGCXXABI::isEmittedWithConstantInitializer ( const VarDecl VD,
bool  InspectInitForWeakDef = false 
) const
protected

Determine whether we will definitely emit this variable with a constant initializer, either because the language semantics demand it or because we know that the initializer is a constant.

Definition at line 176 of file CGCXXABI.cpp.

References clang::VarDecl::evaluateValue(), getContext(), clang::VarDecl::getInitializingDeclaration(), clang::Redeclarable< decl_type >::getMostRecentDecl(), clang::Decl::hasAttr(), clang::VarDecl::hasConstantInitialization(), clang::VarDecl::hasInit(), clang::isUniqueGVALinkage(), clang::ValueDecl::isWeak(), and mayNeedDestruction().

◆ 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 213 of file CGCXXABI.h.

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

◆ isPermittedToBeHomogeneousAggregate()

virtual bool clang::CodeGen::CGCXXABI::isPermittedToBeHomogeneousAggregate ( const CXXRecordDecl RD) const
inlinevirtual

Returns true if the ABI permits the argument to be a homogeneous aggregate.

Definition at line 174 of file CGCXXABI.h.

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

◆ LoadVTablePtr()

virtual std::pair< llvm::Value *, const CXXRecordDecl * > clang::CodeGen::CGCXXABI::LoadVTablePtr ( CodeGenFunction CGF,
Address  This,
const CXXRecordDecl RD 
)
pure virtual

Load a vtable from This, an object of polymorphic type RD, or from one of its virtual bases if it does not have its own vtable.

Returns the vtable and the class from which the vtable was loaded.

◆ mayNeedDestruction()

bool CGCXXABI::mayNeedDestruction ( const VarDecl VD) const
protected

◆ NeedsVTTParameter()

bool CGCXXABI::NeedsVTTParameter ( GlobalDecl  GD)
virtual

Return whether the given global decl needs a VTT parameter.

Definition at line 327 of file CGCXXABI.cpp.

◆ performReturnAdjustment()

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

Referenced by PerformReturnAdjustment().

◆ performThisAdjustment()

virtual llvm::Value * clang::CodeGen::CGCXXABI::performThisAdjustment ( CodeGenFunction CGF,
Address  This,
const CXXRecordDecl UnadjustedClass,
const ThunkInfo TI 
)
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 255 of file CGCXXABI.cpp.

References clang::CodeGen::CodeGenFunction::Builder, clang::CodeGen::CGBuilderTy::CreateConstInBoundsByteGEP(), clang::CodeGen::Address::emitRawPointer(), clang::ast_matchers::expr, getArrayCookieSizeImpl(), clang::CodeGen::CodeGenTypeCache::Int8Ty, readArrayCookieImpl(), requiresArrayCookie(), clang::CodeGen::Address::withElementType(), and clang::CharUnits::Zero().

Referenced by EmitArrayDelete().

◆ 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 276 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::FunctionCallee  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 EmitDeclDestroy(), and pushTemporaryCleanup().

◆ requiresArrayCookie() [1/2]

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

◆ requiresArrayCookie() [2/2]

bool CGCXXABI::requiresArrayCookie ( const CXXNewExpr E)
protectedvirtual

Definition at line 246 of file CGCXXABI.cpp.

References clang::ast_matchers::expr.

◆ setCXXABIThisValue()

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

Initialize the 'this' slot.

Definition at line 157 of file CGCXXABI.cpp.

References getThisDecl().

◆ setCXXDestructorDLLStorage()

void CGCXXABI::setCXXDestructorDLLStorage ( llvm::GlobalValue *  GV,
const CXXDestructorDecl Dtor,
CXXDtorType  DT 
) const
virtual

◆ 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

◆ shouldEmitExactDynamicCast()

virtual bool clang::CodeGen::CGCXXABI::shouldEmitExactDynamicCast ( QualType  DestRecordTy)
pure virtual

◆ shouldTypeidBeNullChecked()

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

Referenced by EmitTypeidFromVTable().

◆ useSinitAndSterm()

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

Definition at line 133 of file CGCXXABI.h.

◆ usesThreadWrapperFunction()

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

Referenced by EmitGlobalVarDeclLValue().

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

Friends And Related Function Documentation

◆ CodeGenModule

friend class CodeGenModule
friend

Definition at line 44 of file CGCXXABI.h.

Member Data Documentation

◆ CGM

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

◆ MangleCtx

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

Definition at line 48 of file CGCXXABI.h.

Referenced by getMangleContext().


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