15 #ifndef LLVM_CLANG_LIB_CODEGEN_CGCXXABI_H 16 #define LLVM_CLANG_LIB_CODEGEN_CGCXXABI_H 30 class CXXConstructorDecl;
31 class CXXDestructorDecl;
39 class CodeGenFunction;
50 : CGM(CGM), MangleCtx(CGM.getContext().createMangleContext()) {}
54 return CGF.CXXABIThisDecl;
57 return CGF.CXXABIThisValue;
60 return Address(CGF.CXXABIThisValue, CGF.CXXABIThisAlignment);
67 llvm::Constant *GetBogusMemberPointer(
QualType T);
70 return CGF.CXXStructorImplicitParamDecl;
73 return CGF.CXXStructorImplicitParamValue;
84 virtual bool requiresArrayCookie(
const CXXNewExpr *E);
90 virtual bool isThisCompleteObject(
GlobalDecl GD)
const = 0;
159 virtual CGCallee EmitLoadOfMemberFunctionPointer(
178 virtual llvm::Constant *EmitMemberPointerConversion(
const CastExpr *E,
179 llvm::Constant *Src);
194 virtual llvm::Constant *EmitMemberFunctionPointer(
const CXXMethodDecl *MD);
201 virtual llvm::Constant *EmitMemberPointer(
const APValue &MP,
QualType MPT);
223 llvm::Constant *getMemberPointerAdjustment(
const CastExpr *E);
243 virtual bool canSpeculativelyEmitVTable(
const CXXRecordDecl *RD)
const = 0;
247 virtual llvm::CallInst *
251 virtual llvm::Constant *getAddrOfRTTIDescriptor(
QualType Ty) = 0;
256 virtual bool shouldTypeidBeNullChecked(
bool IsDeref,
261 llvm::Type *StdTypeInfoPtrTy) = 0;
263 virtual bool shouldDynamicCastCallBeNullChecked(
bool SrcIsPtr,
269 QualType DestRecordTy, llvm::BasicBlock *CastEnd) = 0;
283 virtual llvm::BasicBlock *EmitCtorCompleteObjectHandler(
CodeGenFunction &CGF,
339 Address This,
bool VirtualCall) {
359 return CharUnits::Zero();
377 bool ForVirtualBase,
bool Delegating,
390 virtual bool doStructorsInitializeVPtrs(
const CXXRecordDecl *VTableClass) = 0;
393 virtual llvm::Constant *
406 virtual llvm::Constant *
412 virtual llvm::GlobalVariable *getAddrOfVTable(
const CXXRecordDecl *RD,
435 virtual void emitVirtualInheritanceTables(
const CXXRecordDecl *RD) = 0;
437 virtual void setThunkLinkage(llvm::Function *Thunk,
bool ForVTable,
446 const ReturnAdjustment &RA) = 0;
455 virtual std::vector<CharUnits> getVBPtrOffsets(
const CXXRecordDecl *RD);
458 virtual StringRef GetPureVirtualCallName() = 0;
461 virtual StringRef GetDeletedVirtualCallName() = 0;
510 virtual bool NeedsVTTParameter(
GlobalDecl GD);
543 llvm::GlobalVariable *DeclPtr,
544 bool PerformInit) = 0;
552 llvm::Constant *Dtor,
553 llvm::Constant *Addr) = 0;
566 virtual void EmitThreadLocalInitFuncs(
573 virtual bool usesThreadWrapperFunction()
const = 0;
589 virtual std::pair<llvm::Value *, const CXXRecordDecl *>
A (possibly-)qualified type.
DominatorTree GraphTraits specialization so the DominatorTree can be iterable by generic graph iterat...
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...
The base class of the type hierarchy.
Represents a C++ constructor within a class.
llvm::Value *& getStructorImplicitParamValue(CodeGenFunction &CGF)
VarDecl - An instance of this class is created to represent a variable declaration or definition...
const internal::VariadicDynCastAllOfMatcher< Stmt, Expr > expr
Matches expressions.
A this pointer adjustment.
A C++ throw-expression (C++ [except.throw]).
CodeGenFunction - This class organizes the per-function state that is used while generating LLVM code...
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
ABIArgInfo classifyReturnType(CodeGenModule &CGM, CanQualType type)
Classify the rules for how to return a particular type.
CharUnits - This is an opaque type for sizes expressed in character units.
Forward-declares and imports various common LLVM datatypes that clang wants to use unqualified...
virtual bool hasMostDerivedReturn(GlobalDecl GD) const
ImplicitParamDecl * getThisDecl(CodeGenFunction &CGF)
CastExpr - Base class for type casts, including both implicit casts (ImplicitCastExpr) and explicit c...
virtual bool canCallMismatchedFunctionType() const
Returns true if the target allows calling a function through a pointer with a different signature tha...
RValue - This trivial value class is used to represent the result of an expression that is evaluated...
ImplicitParamDecl *& getStructorImplicitParamDecl(CodeGenFunction &CGF)
virtual bool HasThisReturn(GlobalDecl GD) const
Returns true if the given constructor or destructor is one of the kinds that the ABI says returns 'th...
CXXDtorType
C++ destructor types.
Expr - This represents one expression.
const FunctionProtoType * T
Represents a C++ destructor within a class.
virtual CharUnits getVirtualFunctionPrologueThisAdjustment(GlobalDecl GD)
Get the ABI-specific "this" parameter adjustment to apply in the prologue of a virtual function...
CGCXXABI(CodeGenModule &CGM)
ASTContext & getContext() const
ASTContext & getContext() const
virtual void adjustCallArgsForDestructorThunk(CodeGenFunction &CGF, GlobalDecl GD, CallArgList &CallArgs)
GlobalDecl - represents a global declaration.
The l-value was considered opaque, so the alignment was determined from a type.
Encodes a location in the source.
Represents a new-expression for memory allocation and constructor calls, e.g: "new CXXNewExpr(foo)"...
Represents a call to a member function that may be written either with member call syntax (e...
static AddedStructorArgs suffix(unsigned N)
Represents a static or instance method of a struct/union/class.
MangleContext - Context for tracking state which persists across multiple calls to the C++ name mangl...
All available information about a concrete callee.
MangleContext & getMangleContext()
Gets the mangle context.
CGCXXABI * CreateMicrosoftCXXABI(CodeGenModule &CGM)
Creates a Microsoft-family ABI.
The MS C++ ABI needs a pointer to RTTI data plus some flags to describe the type of a catch handler...
CXXCtorType
C++ constructor types.
FunctionArgList - Type for representing both the decl and type of parameters to a function...
CGFunctionInfo - Class to encapsulate the information about a function definition.
This class organizes the cross-function state that is used while generating LLVM code.
Dataflow Directional Tag Classes.
Represents a delete expression for memory deallocation and destructor calls, e.g. ...
virtual bool isSRetParameterAfterThis() const
Returns true if the implicit 'sret' parameter comes after the implicit 'this' parameter of C++ instan...
static AddedStructorArgs prefix(unsigned N)
virtual bool isMemberPointerConvertible(const MemberPointerType *MPT) const
Return whether or not a member pointers type is convertible to an IR type.
const CXXRecordDecl * getParent() const
Returns the parent of this method declaration, which is the class in which this method is defined...
A pointer to member type per C++ 8.3.3 - Pointers to members.
std::unique_ptr< MangleContext > MangleCtx
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.
Address getThisAddress(CodeGenFunction &CGF)
Implements C++ ABI-specific code generation functions.
APValue - This class implements a discriminated union of [uninitialized] [APSInt] [APFloat]...
Pass it on the stack using its defined layout.
static CGCXXABI::RecordArgABI getRecordArgABI(const RecordType *RT, CGCXXABI &CXXABI)
Represents a C++ struct/union/class.
CGCXXABI * CreateItaniumCXXABI(CodeGenModule &CGM)
Creates an Itanium-family ABI.
virtual const CXXRecordDecl * getThisArgumentTypeForMethod(const CXXMethodDecl *MD)
Get the type of the implicit "this" parameter used by a method.
CXXCatchStmt - This represents a C++ catch block.
Struct with all informations about dynamic [sub]class needed to set vptr.
virtual llvm::GlobalVariable * getThrowInfo(QualType T)
LValue - This represents an lvalue references.
Notes how many arguments were added to the beginning (Prefix) and ending (Suffix) of an arg list...
RecordArgABI
Specify how one should pass an argument of a record type.
CallArgList - Type for representing both the value and type of arguments in a call.
llvm::Value * getThisValue(CodeGenFunction &CGF)
AddedStructorArgs(unsigned P, unsigned S)