28 CIRGenMicrosoftCXXABI(CIRGenModule &cgm) : CIRGenCXXABI(cgm) {}
30 AddedStructorArgCounts
31 buildStructorSignature(GlobalDecl gd,
32 SmallVectorImpl<CanQualType> &argTys)
override {
34 "buildStructorSignature: MSVC ABI");
35 return AddedStructorArgCounts{};
38 void addImplicitStructorParams(CIRGenFunction &cgf, QualType &resTy,
39 FunctionArgList ¶ms)
override {
41 "addImplicitStructorParams: MSVC ABI");
44 void emitInstanceFunctionProlog(SourceLocation loc,
45 CIRGenFunction &cgf)
override {
46 cgf.
cgm.
errorNYI(loc,
"emitInstanceFunctionProlog: MSVC ABI");
49 AddedStructorArgs getImplicitConstructorArgs(CIRGenFunction &cgf,
50 const CXXConstructorDecl *d,
53 bool delegating)
override {
55 "getImplicitConstructorArgs: MSVC ABI");
56 return AddedStructorArgs{};
60 const CXXDestructorDecl *dd,
63 bool delegating)
override {
65 "getCXXDestructorImplicitParam: MSVC ABI");
69 void emitCXXConstructors(
const CXXConstructorDecl *d)
override {
70 cgm.errorNYI(d->
getSourceRange(),
"emitCXXConstructors: MSVC ABI");
73 void emitCXXDestructors(
const CXXDestructorDecl *d)
override {
77 void emitCXXStructor(GlobalDecl gd)
override {
81 void emitDestructorCall(CIRGenFunction &cgf,
const CXXDestructorDecl *dd,
83 bool delegating, Address thisAddr,
84 QualType thisTy)
override {
88 mlir::Value emitVirtualDestructorCall(CIRGenFunction &cgf,
89 const CXXDestructorDecl *dtor,
91 DeleteOrMemberCallExpr e)
override {
93 "emitVirtualDestructorCall: MSVC ABI");
97 void emitVirtualObjectDelete(CIRGenFunction &cgf,
const CXXDeleteExpr *de,
98 Address ptr, QualType elementType,
99 const CXXDestructorDecl *dtor)
override {
103 size_t getSrcArgforCopyCtor(
const CXXConstructorDecl *cd,
104 FunctionArgList &args)
const override {
105 cgm.errorNYI(cd->
getSourceRange(),
"getSrcArgforCopyCtor: MSVC ABI");
106 assert(args.size() >= 2 &&
107 "expected the arglist to have at least two args!");
116 const CXXRecordDecl *
117 getThisArgumentTypeForMethod(
const CXXMethodDecl *md)
override {
119 "getThisArgumentTypeForMethod: MSVC ABI");
123 Address adjustThisArgumentForVirtualFunctionCall(CIRGenFunction &cgf,
126 bool virtualCall)
override {
128 "adjustThisArgumentForVirtualFunctionCall: MSVC ABI");
132 bool isVirtualOffsetNeededForVTableField(CIRGenFunction &cgf,
133 CIRGenFunction::VPtr vptr)
override {
134 cgf.
cgm.
errorNYI(
"isVirtualOffsetNeededForVTableField: MSVC ABI");
138 cir::GlobalOp getAddrOfVTable(
const CXXRecordDecl *rd,
139 CharUnits vptrOffset)
override {
144 mlir::Value getVTableAddressPoint(BaseSubobject base,
145 const CXXRecordDecl *vtableClass)
override {
147 "getVTableAddressPoint: MSVC ABI");
151 mlir::Value getVTableAddressPointInStructor(
152 CIRGenFunction &cgf,
const CXXRecordDecl *vtableClass, BaseSubobject base,
153 const CXXRecordDecl *nearestVBase)
override {
155 "getVTableAddressPointInStructor: MSVC ABI");
159 CIRGenCallee getVirtualFunctionPointer(CIRGenFunction &cgf, GlobalDecl gd,
160 Address thisAddr, mlir::Type ty,
161 SourceLocation loc)
override {
162 cgf.
cgm.
errorNYI(loc,
"getVirtualFunctionPointer: MSVC ABI");
163 return CIRGenCallee();
166 void emitVTableDefinitions(CIRGenVTables &cgvt,
167 const CXXRecordDecl *rd)
override {
168 cgm.errorNYI(rd->
getSourceRange(),
"emitVTableDefinitions: MSVC ABI");
171 void emitVirtualInheritanceTables(
const CXXRecordDecl *rd)
override {
173 "emitVirtualInheritanceTables: MSVC ABI");
177 initializeHiddenVirtualInheritanceMembers(CIRGenFunction &cgf,
178 const CXXRecordDecl *rd)
override {
180 "initializeHiddenVirtualInheritanceMembers: MSVC ABI");
184 getVirtualBaseClassOffset(mlir::Location loc, CIRGenFunction &cgf,
185 Address thisAddr,
const CXXRecordDecl *classDecl,
186 const CXXRecordDecl *baseClassDecl)
override {
187 cgf.
cgm.
errorNYI(loc,
"getVirtualBaseClassOffset: MSVC ABI");
191 cir::MethodAttr buildVirtualMethodAttr(cir::MethodType methodTy,
192 const CXXMethodDecl *md)
override {
193 cgm.errorNYI(md->
getSourceRange(),
"buildVirtualMethodAttr: MSVC ABI");
194 return cir::MethodAttr();
197 mlir::Value performThisAdjustment(CIRGenFunction &cgf, Address thisAddr,
198 const CXXRecordDecl *unadjustedClass,
199 const ThunkInfo &ti)
override {
200 cgf.
cgm.
errorNYI(
"performThisAdjustment: MSVC ABI");
205 const CXXRecordDecl *unadjustedClass,
206 const ReturnAdjustment &ra)
override {
207 cgf.
cgm.
errorNYI(
"performReturnAdjustment: MSVC ABI");
211 bool canSpeculativelyEmitVTable(
const CXXRecordDecl *rd)
const override {
215 bool doStructorsInitializeVPtrs(
const CXXRecordDecl *vtableClass)
override {
217 "doStructorsInitializeVPtrs: MSVC ABI");
221 bool exportThunk()
override {
return false; }
223 bool useThunkForDtorVariant(
const CXXDestructorDecl *dtor,
225 cgm.errorNYI(dtor->
getSourceRange(),
"useThunkForDtorVariant: MSVC ABI");
229 void setThunkLinkage(cir::FuncOp thunk,
bool forVTable, GlobalDecl gd,
230 bool returnAdjustment)
override {
234 StringRef getPureVirtualCallName()
override {
return "_purecall"; }
235 StringRef getDeletedVirtualCallName()
override {
return "_purecall"; }
237 bool isZeroInitializable(
const MemberPointerType *mpt)
override {
238 cgm.errorNYI(
"isZeroInitializable: MSVC ABI");
242 bool requiresArrayCookie(
const CXXNewExpr *e)
override {
243 cgm.errorNYI(e->
getSourceRange(),
"requiresArrayCookie: MSVC ABI");
247 CharUnits getArrayCookieSizeImpl(QualType elementType)
override {
248 cgm.errorNYI(
"getArrayCookieSizeImpl: MSVC ABI");
252 Address initializeArrayCookie(CIRGenFunction &cgf, Address newPtr,
253 mlir::Value numElements,
const CXXNewExpr *e,
254 QualType elementType)
override {
259 bool shouldTypeidBeNullChecked(QualType srcTy)
override {
260 cgm.errorNYI(
"shouldTypeidBeNullChecked: MSVC ABI");
264 mlir::Value emitTypeid(CIRGenFunction &cgf, QualType srcTy, Address thisPtr,
265 mlir::Type typeInfoPtrTy)
override {
267 "emitTypeid: MSVC ABI");
272 void emitBadTypeidCall(CIRGenFunction &cgf, mlir::Location loc)
override {
273 cgf.
cgm.
errorNYI(loc,
"emitBadTypeidCall: MSVC ABI");
276 void emitBadCastCall(CIRGenFunction &cgf, mlir::Location loc)
override {
277 cgm.errorNYI(loc,
"emitBadCastCall: MSVC ABI");
280 mlir::Value emitDynamicCast(CIRGenFunction &cgf, mlir::Location loc,
281 QualType srcRecordTy, QualType destRecordTy,
282 cir::PointerType destCIRTy,
bool isRefCast,
283 Address src)
override {
284 cgf.
cgm.
errorNYI(loc,
"emitDynamicCast: MSVC ABI");
288 mlir::Attribute getAddrOfRTTIDescriptor(mlir::Location loc,
289 QualType ty)
override {
290 cgm.errorNYI(loc,
"getAddrOfRTTIDescriptor: MSVC ABI");
294 CatchTypeInfo getCatchAllTypeInfo()
override {
295 cgm.errorNYI(
"getCatchAllTypeInfo: MSVC ABI");
296 return CatchTypeInfo{
nullptr, 0};
300 getAddrOfCXXCatchHandlerType(mlir::Location loc, QualType ty,
301 QualType catchHandlerType)
override {
302 cgm.errorNYI(loc,
"getAddrOfCXXCatchHandlerType: MSVC ABI");
303 return CatchTypeInfo{
nullptr, 0};
306 void emitRethrow(CIRGenFunction &cgf,
bool isNoReturn)
override {
307 cgm.errorNYI(
"emitRethrow: MSVC ABI");
310 void emitThrow(CIRGenFunction &cgf,
const CXXThrowExpr *e)
override {
314 void registerGlobalDtor(
const VarDecl *vd, cir::FuncOp dtor,
315 mlir::Value addr)
override {
316 cgm.errorNYI(vd->
getSourceRange(),
"registerGlobalDtor: MSVC ABI");
323 return new CIRGenMicrosoftCXXABI(cgm);
static RValue performReturnAdjustment(CIRGenFunction &cgf, QualType resultType, RValue rv, const ThunkInfo &thunk)
Defines the C++ Decl subclasses, other than those for templates (found in DeclTemplate....
cir::ConstantOp getNullPtr(mlir::Type ty, mlir::Location loc)
mlir::Value emitRawPointer() const
Return the pointer contained in this class after authenticating it and adding offset to it if necessa...
Implements C++ ABI-specific code generation functions.
clang::GlobalDecl curGD
The GlobalDecl for the current function being compiled or the global variable currently being initial...
mlir::Location getLoc(clang::SourceLocation srcLoc)
Helpers to convert Clang's SourceLocation to a MLIR Location.
CIRGenBuilderTy & getBuilder()
This class organizes the cross-function state that is used while generating CIR code.
DiagnosticBuilder errorNYI(SourceLocation, llvm::StringRef)
Helpers to emit "not yet implemented" error diagnostics.
const CXXRecordDecl * getParent() const
Return the parent of this method declaration, which is the class in which this method is defined.
SourceRange getSourceRange() const
unsigned getNumVBases() const
Retrieves the number of virtual base classes of this class.
static CharUnits Zero()
Zero - Construct a CharUnits quantity of zero.
SourceLocation getLocation() const
virtual SourceRange getSourceRange() const LLVM_READONLY
Source range that this declaration covers.
SourceRange getSourceRange() const override LLVM_READONLY
Source range that this declaration covers.
const Decl * getDecl() const
SourceRange getSourceRange() const LLVM_READONLY
SourceLocation tokens are not useful in isolation - they are low level value objects created/interpre...
SourceRange getSourceRange() const override LLVM_READONLY
Source range that this declaration covers.
CXXRecordDecl * getAsCXXRecordDecl() const
Retrieves the CXXRecordDecl that this type refers to, either because the type is a RecordType or beca...
const T * castAs() const
Member-template castAs<specific type>.
SourceRange getSourceRange() const override LLVM_READONLY
Source range that this declaration covers.
CIRGenCXXABI * CreateCIRGenMicrosoftCXXABI(CIRGenModule &cgm)
Creates Microsoft ABI.
llvm::Value * getCXXDestructorImplicitParam(CodeGenModule &CGM, llvm::BasicBlock *InsertBlock, llvm::BasicBlock::iterator InsertPoint, const CXXDestructorDecl *D, CXXDtorType Type, bool ForVirtualBase, bool Delegating)
const internal::VariadicAllOfMatcher< Type > type
Matches Types in the clang AST.
@ Address
A pointer to a ValueDecl.
Top level wrappers for InstallAPI frontend operations.
CXXCtorType
C++ constructor types.
CXXDtorType
C++ destructor types.