clang
3.7.0
|
Implements C++ ABI-specific code generation functions. More...
#include <CGCXXABI.h>
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 () |
MangleContext & | getMangleContext () |
Gets the mangle context. More... | |
virtual bool | HasThisReturn (GlobalDecl GD) const |
virtual bool | hasMostDerivedReturn (GlobalDecl GD) const |
virtual bool | classifyReturnType (CGFunctionInfo &FI) const =0 |
bool | canCopyArgument (const CXXRecordDecl *RD) const |
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 |
virtual llvm::Type * | ConvertMemberPointerType (const MemberPointerType *MPT) |
virtual llvm::Value * | EmitLoadOfMemberFunctionPointer (CodeGenFunction &CGF, const Expr *E, llvm::Value *&This, llvm::Value *MemPtr, const MemberPointerType *MPT) |
virtual llvm::Value * | EmitMemberDataPointerAddress (CodeGenFunction &CGF, const Expr *E, llvm::Value *Base, llvm::Value *MemPtr, const MemberPointerType *MPT) |
Calculate an l-value from an object and a data member pointer. More... | |
virtual llvm::Value * | EmitMemberPointerConversion (CodeGenFunction &CGF, const CastExpr *E, llvm::Value *Src) |
virtual llvm::Constant * | EmitMemberPointerConversion (const CastExpr *E, llvm::Constant *Src) |
virtual bool | isZeroInitializable (const MemberPointerType *MPT) |
virtual bool | isMemberPointerConvertible (const MemberPointerType *MPT) const |
Return whether or not a member pointers type is convertible to an IR type. More... | |
virtual bool | isTypeInfoCalculable (QualType Ty) const |
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::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. More... | |
virtual llvm::Value * | EmitMemberPointerIsNotNull (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, llvm::Value *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 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 llvm::Constant * | getAddrOfCXXCatchHandlerType (QualType Ty, QualType CatchHandlerType)=0 |
virtual bool | shouldTypeidBeNullChecked (bool IsDeref, QualType SrcRecordTy)=0 |
virtual void | EmitBadTypeidCall (CodeGenFunction &CGF)=0 |
virtual llvm::Value * | EmitTypeid (CodeGenFunction &CGF, QualType SrcRecordTy, llvm::Value *ThisPtr, llvm::Type *StdTypeInfoPtrTy)=0 |
virtual bool | shouldDynamicCastCallBeNullChecked (bool SrcIsPtr, QualType SrcRecordTy)=0 |
virtual llvm::Value * | EmitDynamicCastCall (CodeGenFunction &CGF, llvm::Value *Value, QualType SrcRecordTy, QualType DestTy, QualType DestRecordTy, llvm::BasicBlock *CastEnd)=0 |
virtual llvm::Value * | EmitDynamicCastToVoid (CodeGenFunction &CGF, llvm::Value *Value, QualType SrcRecordTy, QualType DestTy)=0 |
virtual bool | EmitBadCastCall (CodeGenFunction &CGF)=0 |
virtual llvm::Value * | GetVirtualBaseClassOffset (CodeGenFunction &CGF, llvm::Value *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) |
virtual void | EmitCXXConstructors (const CXXConstructorDecl *D)=0 |
Emit constructor variants required by this ABI. More... | |
virtual void | buildStructorSignature (const CXXMethodDecl *MD, StructorType T, SmallVectorImpl< CanQualType > &ArgTys)=0 |
virtual bool | useThunkForDtorVariant (const CXXDestructorDecl *Dtor, CXXDtorType DT) const =0 |
virtual void | EmitCXXDestructors (const CXXDestructorDecl *D)=0 |
Emit destructor variants required by this ABI. More... | |
virtual const CXXRecordDecl * | getThisArgumentTypeForMethod (const CXXMethodDecl *MD) |
virtual llvm::Value * | adjustThisArgumentForVirtualFunctionCall (CodeGenFunction &CGF, GlobalDecl GD, llvm::Value *This, bool VirtualCall) |
void | buildThisParam (CodeGenFunction &CGF, FunctionArgList &Params) |
Build a parameter variable suitable for 'this'. More... | |
virtual void | addImplicitStructorParams (CodeGenFunction &CGF, QualType &ResTy, FunctionArgList &Params)=0 |
virtual llvm::Value * | adjustThisParameterInVirtualFunctionPrologue (CodeGenFunction &CGF, GlobalDecl GD, llvm::Value *This) |
virtual void | EmitInstanceFunctionProlog (CodeGenFunction &CGF)=0 |
Emit the ABI-specific prolog for the function. More... | |
virtual unsigned | addImplicitConstructorArgs (CodeGenFunction &CGF, const CXXConstructorDecl *D, CXXCtorType Type, bool ForVirtualBase, bool Delegating, CallArgList &Args)=0 |
virtual void | EmitDestructorCall (CodeGenFunction &CGF, const CXXDestructorDecl *DD, CXXDtorType Type, bool ForVirtualBase, bool Delegating, llvm::Value *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 llvm::Value * | getVTableAddressPointInStructor (CodeGenFunction &CGF, const CXXRecordDecl *RD, BaseSubobject Base, const CXXRecordDecl *NearestVBase, bool &NeedsVirtualOffset)=0 |
virtual llvm::Constant * | getVTableAddressPointForConstExpr (BaseSubobject Base, const CXXRecordDecl *VTableClass)=0 |
virtual llvm::GlobalVariable * | getAddrOfVTable (const CXXRecordDecl *RD, CharUnits VPtrOffset)=0 |
virtual llvm::Value * | getVirtualFunctionPointer (CodeGenFunction &CGF, GlobalDecl GD, llvm::Value *This, llvm::Type *Ty, SourceLocation Loc)=0 |
Build a virtual function pointer in the ABI-specific way. More... | |
virtual llvm::Value * | EmitVirtualDestructorCall (CodeGenFunction &CGF, const CXXDestructorDecl *Dtor, CXXDtorType DtorType, llvm::Value *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 |
virtual void | setThunkLinkage (llvm::Function *Thunk, bool ForVTable, GlobalDecl GD, bool ReturnAdjustment)=0 |
virtual llvm::Value * | performThisAdjustment (CodeGenFunction &CGF, llvm::Value *This, const ThisAdjustment &TA)=0 |
virtual llvm::Value * | performReturnAdjustment (CodeGenFunction &CGF, llvm::Value *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 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) |
virtual llvm::Value * | InitializeArrayCookie (CodeGenFunction &CGF, llvm::Value *NewPtr, llvm::Value *NumElements, const CXXNewExpr *expr, QualType ElementType) |
virtual void | ReadArrayCookie (CodeGenFunction &CGF, llvm::Value *Ptr, const CXXDeleteExpr *expr, QualType ElementType, llvm::Value *&NumElements, llvm::Value *&AllocPtr, CharUnits &CookieSize) |
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 |
virtual void | registerGlobalDtor (CodeGenFunction &CGF, const VarDecl &D, llvm::Constant *Dtor, llvm::Constant *Addr)=0 |
virtual void | EmitThreadLocalInitFuncs (CodeGenModule &CGM, ArrayRef< std::pair< const VarDecl *, llvm::GlobalVariable * >> CXXThreadLocals, ArrayRef< llvm::Function * > CXXThreadLocalInits, ArrayRef< llvm::GlobalVariable * > CXXThreadLocalInitVars)=0 |
virtual bool | usesThreadWrapperFunction () const =0 |
virtual LValue | EmitThreadLocalVarDeclLValue (CodeGenFunction &CGF, const VarDecl *VD, QualType LValType)=0 |
virtual void | emitCXXStructor (const CXXMethodDecl *MD, StructorType Type)=0 |
Protected Attributes | |
CodeGenModule & | CGM |
std::unique_ptr< MangleContext > | MangleCtx |
Implements C++ ABI-specific code generation functions.
Definition at line 42 of file CGCXXABI.h.
Specify how one should pass an argument of a record type.
Definition at line 104 of file CGCXXABI.h.
|
inlineprotected |
Definition at line 47 of file CGCXXABI.h.
|
virtual |
Definition at line 20 of file CGCXXABI.cpp.
|
pure virtual |
Add any ABI-specific implicit arguments needed to call a constructor.
Referenced by clang::CodeGen::CodeGenFunction::EmitCXXConstructorCall().
|
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::GenerateCode(), and clang::CodeGen::CodeGenFunction::StartThunk().
|
inlinevirtual |
Definition at line 378 of file CGCXXABI.h.
Referenced by clang::CodeGen::CodeGenFunction::EmitCallAndReturnForThunk().
|
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 298 of file CGCXXABI.h.
Referenced by clang::CodeGen::CodeGenFunction::EmitCXXMemberOrOperatorMemberCallExpr().
|
inlinevirtual |
Perform ABI-specific "this" parameter adjustment in a virtual function prologue.
Definition at line 319 of file CGCXXABI.h.
|
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().
void CGCXXABI::buildThisParam | ( | CodeGenFunction & | CGF, |
FunctionArgList & | Params | ||
) |
Build a parameter variable suitable for 'this'.
Definition at line 152 of file CGCXXABI.cpp.
References CGM, clang::ImplicitParamDecl::Create(), clang::CodeGen::CodeGenFunction::CurGD, clang::IdentifierTable::get(), clang::CodeGen::CodeGenModule::getContext(), clang::GlobalDecl::getDecl(), clang::Decl::getLocation(), getThisDecl(), clang::CXXMethodDecl::getThisType(), and clang::ASTContext::Idents.
Referenced by clang::CodeGen::CodeGenFunction::GenerateCode(), and clang::CodeGen::CodeGenFunction::StartThunk().
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 31 of file CGCXXABI.cpp.
References clang::CXXRecordDecl::ctors(), clang::CXXRecordDecl::hasNonTrivialCopyConstructor(), clang::CXXRecordDecl::hasNonTrivialDestructor(), and clang::CXXRecordDecl::hasNonTrivialMoveConstructor().
|
pure virtual |
If the C++ ABI requires the given type be returned in a particular way, this method sets RetAI and returns true.
|
virtual |
Find the LLVM type used to represent the given member pointer type.
Definition at line 71 of file CGCXXABI.cpp.
References CGM, clang::CodeGen::CodeGenTypes::ConvertType(), clang::CodeGen::CodeGenModule::getContext(), clang::ASTContext::getPointerDiffType(), and clang::CodeGen::CodeGenModule::getTypes().
Referenced by clang::CodeGen::CodeGenTypes::ConvertType().
|
pure virtual |
Referenced by EmitDynamicCastToNull().
|
pure virtual |
Referenced by EmitTypeidFromVTable().
|
pure virtual |
Referenced by clang::CodeGen::CodeGenFunction::ExitCXXTryStmt().
|
virtual |
Definition at line 292 of file CGCXXABI.cpp.
References CGM, ErrorUnsupportedABI(), clang::TargetInfo::getCXXABI(), clang::CodeGen::CodeGenModule::getTarget(), and clang::TargetCXXABI::hasConstructorVariants().
Referenced by clang::CodeGen::CodeGenFunction::EmitCtorPrologue().
|
pure virtual |
Emit constructor variants required by this ABI.
Referenced by clang::CodeGen::CodeGenModule::EmitTopLevelDecl().
|
pure virtual |
Emit destructor variants required by this ABI.
Referenced by clang::CodeGen::CodeGenModule::EmitTopLevelDecl().
|
pure virtual |
Emit a single constructor/destructor with the given type from a C++ constructor Decl.
|
pure virtual |
Emit the destructor call.
Referenced by clang::CodeGen::CodeGenFunction::EmitCXXDestructorCall().
|
pure virtual |
Referenced by clang::CodeGen::CodeGenFunction::EmitDynamicCast().
|
pure virtual |
Referenced by clang::CodeGen::CodeGenFunction::EmitDynamicCast().
|
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:
Referenced by clang::CodeGen::CodeGenFunction::EmitCXXGuardedInit().
|
pure virtual |
Emit the ABI-specific prolog for the function.
Referenced by clang::CodeGen::CodeGenFunction::StartFunction(), and clang::CodeGen::CodeGenFunction::StartThunk().
|
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 75 of file CGCXXABI.cpp.
References clang::CodeGen::CodeGenTypes::arrangeCXXMethodType(), CGM, ErrorUnsupportedABI(), clang::Type::getAs(), clang::MemberPointerType::getClass(), clang::CodeGen::CodeGenTypes::GetFunctionType(), clang::MemberPointerType::getPointeeType(), and clang::CodeGen::CodeGenModule::getTypes().
Referenced by clang::CodeGen::CodeGenFunction::EmitCXXMemberPointerCallExpr().
|
virtual |
Create a member pointer for the given field.
Definition at line 138 of file CGCXXABI.cpp.
References GetBogusMemberPointer().
Referenced by clang::CodeGen::CodeGenModule::getMemberPointerConstant().
|
virtual |
Calculate an l-value from an object and a data member pointer.
Definition at line 90 of file CGCXXABI.cpp.
References clang::CodeGen::CodeGenFunction::ConvertType(), ErrorUnsupportedABI(), and clang::MemberPointerType::getPointeeType().
Referenced by clang::CodeGen::CodeGenFunction::EmitMaterializeTemporaryExpr().
|
virtual |
Create a member pointer for the given method.
Definition at line 133 of file CGCXXABI.cpp.
References CGM, GetBogusMemberPointer(), clang::CodeGen::CodeGenModule::getContext(), clang::ASTContext::getMemberPointerType(), clang::CXXMethodDecl::getParent(), clang::ValueDecl::getType(), and clang::TypeDecl::getTypeForDecl().
Referenced by clang::CodeGen::CodeGenModule::getMemberPointerConstant().
Create a member pointer for the given member pointer constant.
Definition at line 143 of file CGCXXABI.cpp.
References GetBogusMemberPointer().
Referenced by clang::CodeGen::CodeGenModule::EmitConstantValue().
|
virtual |
Emit a comparison between two member pointers. Returns an i1.
Definition at line 111 of file CGCXXABI.cpp.
References clang::CodeGen::CodeGenFunction::Builder, and ErrorUnsupportedABI().
|
virtual |
Perform a derived-to-base, base-to-derived, or bitcast member pointer conversion.
Definition at line 98 of file CGCXXABI.cpp.
References ErrorUnsupportedABI(), GetBogusMemberPointer(), and clang::Expr::getType().
|
virtual |
Perform a derived-to-base, base-to-derived, or bitcast member pointer conversion on a constant value.
Definition at line 105 of file CGCXXABI.cpp.
References GetBogusMemberPointer(), and clang::Expr::getType().
|
virtual |
Determine if a member pointer is non-null. Returns an i1.
Definition at line 121 of file CGCXXABI.cpp.
References clang::CodeGen::CodeGenFunction::Builder, and ErrorUnsupportedABI().
Referenced by clang::CodeGen::CodeGenFunction::EvaluateExprAsBool().
|
virtual |
Create a null member pointer of the given type.
Definition at line 129 of file CGCXXABI.cpp.
References GetBogusMemberPointer().
Referenced by clang::CodeGen::CodeGenModule::EmitNullConstant().
|
pure virtual |
|
virtual |
Definition at line 173 of file CGCXXABI.cpp.
Referenced by clang::CodeGen::CodeGenFunction::EmitCallAndReturnForThunk().
|
virtual |
Definition at line 306 of file CGCXXABI.cpp.
References clang::CodeGen::CodeGenFunction::CGM, clang::CodeGen::CodeGenFunction::EmitNounwindRuntimeCall(), and clang::CodeGen::CodeGenModule::getTerminateFn().
Referenced by clang::CodeGen::CodeGenFunction::getTerminateHandler(), and clang::CodeGen::CodeGenFunction::getTerminateLandingPad().
|
protected |
Perform prolog initialization of the parameter variable suitable for 'this' emitted by buildThisParam.
Initialize the 'this' slot.
Definition at line 165 of file CGCXXABI.cpp.
References clang::CodeGen::CodeGenFunction::Builder, clang::CodeGen::CodeGenFunction::GetAddrOfLocalVar(), getThisDecl(), and getThisValue().
|
pure virtual |
Emits ABI-required functions necessary to initialize thread_local variables in this translation unit.
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. |
|
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().
|
pure virtual |
Referenced by clang::CodeGen::CodeGenFunction::EmitCXXThrowExpr().
|
pure virtual |
Referenced by EmitTypeidFromVTable().
|
pure virtual |
Emit the ABI-specific virtual destructor call.
Referenced by clang::CodeGen::CodeGenFunction::EmitCXXMemberOrOperatorMemberCallExpr().
|
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().
|
pure virtual |
Referenced by EmitObjectDelete().
|
pure virtual |
Emits the VTable definitions required for the given record type.
Referenced by clang::CodeGen::CodeGenVTables::GenerateClassData().
|
protected |
Issue a diagnostic about unsupported features in the ABI.
Definition at line 22 of file CGCXXABI.cpp.
References clang::CodeGen::CodeGenFunction::CGM, clang::CodeGen::CodeGenFunction::CurCodeDecl, clang::DiagnosticsEngine::Error, clang::CodeGen::CodeGenFunction::getContext(), clang::DiagnosticsEngine::getCustomDiagID(), clang::CodeGen::CodeGenModule::getDiags(), clang::ASTContext::getFullLoc(), clang::Decl::getLocation(), clang::DiagnosticsEngine::Report(), and S.
Referenced by EmitCtorCompleteObjectHandler(), EmitLoadOfMemberFunctionPointer(), EmitMemberDataPointerAddress(), EmitMemberPointerComparison(), EmitMemberPointerConversion(), EmitMemberPointerIsNotNull(), InitializeArrayCookie(), and readArrayCookieImpl().
|
pure virtual |
Referenced by clang::CodeGen::CodeGenModule::GetAddrOfRTTIDescriptor().
|
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().
|
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:
expr | - the new-expression being allocated. |
Definition at line 178 of file CGCXXABI.cpp.
References clang::CXXNewExpr::getAllocatedType(), getArrayCookieSizeImpl(), requiresArrayCookie(), and clang::CharUnits::Zero().
Referenced by CalculateCookiePadding().
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 184 of file CGCXXABI.cpp.
References clang::CharUnits::Zero().
Referenced by GetArrayCookieSize(), and ReadArrayCookie().
|
protected |
Get a null value for unsupported member pointers.
Definition at line 66 of file CGCXXABI.cpp.
References CGM, clang::CodeGen::CodeGenTypes::ConvertType(), and clang::CodeGen::CodeGenModule::getTypes().
Referenced by EmitMemberDataPointer(), EmitMemberFunctionPointer(), EmitMemberPointer(), EmitMemberPointerConversion(), and EmitNullMemberPointer().
|
inlineprotected |
Definition at line 75 of file CGCXXABI.h.
References CGM, and clang::CodeGen::CodeGenModule::getContext().
Referenced by getMemberPointerPathAdjustment().
|
pure virtual |
Gets the deleted virtual member call name.
Referenced by clang::CodeGen::CodeGenVTables::CreateVTableInitializer().
|
inline |
Gets the mangle context.
Definition at line 85 of file CGCXXABI.h.
References MangleCtx.
Referenced by clang::CodeGen::CodeGenFunction::CodeGenFunction(), clang::CodeGen::CodeGenFunction::createAtExitStub(), clang::CodeGen::CodeGenModule::CreateVTableBitSetEntry(), clang::CodeGen::CodeGenFunction::EmitVTablePtrCheck(), clang::CodeGen::CodeGenFunction::EmitVTablePtrCheckForCast(), clang::CodeGen::CodeGenVTables::GenerateConstructionVTable(), clang::CodeGen::CodeGenModule::GetAddrOfConstantStringFromLiteral(), clang::CodeGen::CodeGenModule::GetAddrOfGlobalTemporary(), clang::CodeGen::CodeGenModule::GetAddrOfThunk(), clang::CodeGen::CodeGenVTables::GetAddrOfVTT(), clang::CodeGen::CodeGenModule::getBlockMangledName(), clang::CodeGen::CodeGenModule::getMangledName(), getUniqueTagTypeName(), and clang::CodeGen::CodeGenFunction::startOutlinedSEHHelper().
|
protected |
A utility method for computing the offset required for the given base-to-derived or derived-to-base member-pointer conversion. Does not handle virtual conversions (in case we ever fully support an ABI that allows this). Returns null if no adjustment is required.
Returns the adjustment, in bytes, required for the given member-pointer operation. Returns null if no adjustment is required.
Definition at line 251 of file CGCXXABI.cpp.
References CGM, clang::CK_BaseToDerivedMemberPointer, clang::CK_DerivedToBaseMemberPointer, clang::Type::getAsCXXRecordDecl(), clang::CastExpr::getCastKind(), clang::CodeGen::CodeGenModule::GetNonVirtualBaseClassOffset(), clang::CastExpr::getSubExpr(), clang::Expr::getType(), clang::CastExpr::path_begin(), and clang::CastExpr::path_end().
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 269 of file CGCXXABI.cpp.
References clang::ASTContext::getASTRecordLayout(), clang::ASTRecordLayout::getBaseClassOffset(), getContext(), clang::Decl::getDeclContext(), clang::APValue::getMemberPointerDecl(), clang::APValue::getMemberPointerPath(), clang::APValue::isMemberPointerToDerivedMember(), and clang::CharUnits::Zero().
|
pure virtual |
Gets the pure virtual member call function.
Referenced by clang::CodeGen::CodeGenVTables::CreateVTableInitializer().
|
pure virtual |
Returns how an argument of the given record type should be passed.
Referenced by clang::CodeGen::CodeGenFunction::EmitCallArg(), getRecordArgABI(), and isInAllocaArgument().
|
pure virtual |
Referenced by EmitMemberInitializer().
|
inlineprotected |
Definition at line 64 of file CGCXXABI.h.
|
inlineprotected |
Definition at line 67 of file CGCXXABI.h.
|
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 290 of file CGCXXABI.h.
References clang::CXXMethodDecl::getParent().
Referenced by clang::CodeGen::CodeGenTypes::arrangeCXXMethodDeclaration().
|
inlineprotected |
Definition at line 51 of file CGCXXABI.h.
Referenced by buildThisParam(), and EmitThisParam().
|
inlineprotected |
Definition at line 54 of file CGCXXABI.h.
Referenced by EmitThisParam().
|
inlinevirtual |
Definition at line 219 of file CGCXXABI.h.
|
pure virtual |
|
pure virtual |
Build a virtual function pointer in the ABI-specific way.
Referenced by clang::CodeGen::CodeGenFunction::EmitCXXMemberOrOperatorMemberCallExpr().
|
pure virtual |
Get the address point of the vtable for the given base subobject while building a constexpr.
|
pure virtual |
Get the address point of the vtable for the given base subobject while building a constructor or a destructor. On return, NeedsVirtualOffset tells if a virtual base adjustment is needed in order to get the offset of the base subobject.
Referenced by clang::CodeGen::CodeGenFunction::InitializeVTablePointer().
|
inlinevirtual |
Definition at line 97 of file CGCXXABI.h.
Referenced by clang::CodeGen::CodeGenTypes::arrangeCXXConstructorCall(), clang::CodeGen::CodeGenTypes::arrangeCXXStructorDeclaration(), clang::CodeGen::CodeGenFunction::EmitCallAndReturnForThunk(), clang::CodeGen::CodeGenFunction::GenerateCode(), and clang::CodeGen::CodeGenFunction::StartThunk().
|
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 95 of file CGCXXABI.h.
Referenced by clang::CodeGen::CodeGenTypes::arrangeCXXConstructorCall(), clang::CodeGen::CodeGenTypes::arrangeCXXStructorDeclaration(), clang::CodeGen::CodeGenFunction::EmitCallAndReturnForThunk(), clang::CodeGen::CodeGenFunction::GenerateCode(), and clang::CodeGen::CodeGenFunction::StartThunk().
|
virtual |
Initialize the array cookie for the given allocation.
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 189 of file CGCXXABI.cpp.
References ErrorUnsupportedABI().
Referenced by clang::CodeGen::CodeGenFunction::EmitCXXNewExpr().
|
inlinevirtual |
Emit the code to initialize hidden members required to handle virtual inheritance, if needed by the ABI.
Definition at line 264 of file CGCXXABI.h.
Referenced by clang::CodeGen::CodeGenFunction::InitializeVTablePointers().
|
inlinevirtual |
Return whether or not a member pointers type is convertible to an IR type.
Definition at line 163 of file CGCXXABI.h.
Referenced by clang::CodeGen::CodeGenTypes::isFuncParamTypeConvertible().
|
inlinevirtual |
Returns true if the implicit 'sret' parameter comes after the implicit 'this' parameter of C++ instance methods.
Definition at line 127 of file CGCXXABI.h.
Definition at line 167 of file CGCXXABI.h.
References clang::Type::isIncompleteType().
Referenced by clang::CodeGen::CodeGenFunction::MakeNaturalAlignAddrLValue().
|
virtual |
Return true if the given member pointer can be zero-initialized (in the C++ sense) with an LLVM zeroinitializer.
Definition at line 147 of file CGCXXABI.cpp.
Referenced by clang::CodeGen::CodeGenTypes::isZeroInitializable().
|
virtual |
Return whether the given global decl needs a VTT parameter.
Definition at line 301 of file CGCXXABI.cpp.
Referenced by clang::CodeGen::CodeGenFunction::EmitDelegateCXXConstructorCall(), and clang::CodeGen::CodeGenFunction::GetVTTParameter().
|
pure virtual |
Referenced by PerformReturnAdjustment().
|
pure virtual |
|
virtual |
Reads the array cookie associated with the given pointer, if it has one.
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 218 of file CGCXXABI.cpp.
References clang::CodeGen::CodeGenFunction::Builder, getArrayCookieSizeImpl(), clang::CharUnits::getQuantity(), clang::CodeGen::CodeGenTypeCache::Int8Ty, readArrayCookieImpl(), requiresArrayCookie(), and clang::CharUnits::Zero().
Referenced by EmitArrayDelete().
|
protectedvirtual |
Reads the array cookie for an allocation which is known to have one. This is called by the standard implementation of ReadArrayCookie.
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.
Definition at line 241 of file CGCXXABI.cpp.
References ErrorUnsupportedABI(), and clang::CodeGen::CodeGenTypeCache::SizeTy.
Referenced by ReadArrayCookie().
|
pure virtual |
Emit code to force the execution of a destructor during global teardown. The default implementation of this uses atexit.
Dtor | - a function taking a single pointer argument |
Addr | - a pointer to pass to the destructor function. |
Referenced by EmitDeclDestroy(), and pushTemporaryCleanup().
|
protectedvirtual |
Definition at line 199 of file CGCXXABI.cpp.
References clang::CXXDeleteExpr::doesUsualArrayDeleteWantSize(), and clang::QualType::isDestructedType().
Referenced by GetArrayCookieSize(), and ReadArrayCookie().
|
protectedvirtual |
Definition at line 209 of file CGCXXABI.cpp.
References clang::CXXNewExpr::doesUsualArrayDeleteWantSize(), clang::CXXNewExpr::getAllocatedType(), and clang::QualType::isDestructedType().
|
pure virtual |
Referenced by setThunkProperties().
|
pure virtual |
Referenced by clang::CodeGen::CodeGenFunction::EmitDynamicCast().
|
pure virtual |
Referenced by EmitTypeidFromVTable().
|
pure virtual |
Referenced by EmitGlobalVarDeclLValue().
|
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().
|
protected |
Definition at line 44 of file CGCXXABI.h.
Referenced by buildThisParam(), ConvertMemberPointerType(), EmitCtorCompleteObjectHandler(), EmitLoadOfMemberFunctionPointer(), EmitMemberFunctionPointer(), GetBogusMemberPointer(), getContext(), and getMemberPointerAdjustment().
|
protected |
Definition at line 45 of file CGCXXABI.h.
Referenced by getMangleContext().