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");
152 getVTableAddressPointAttr(BaseSubobject base,
153 const CXXRecordDecl *vtableClass)
override {
155 "getVTableAddressPointAttr: MSVC ABI");
159 mlir::Value getVTableAddressPointInStructor(
160 CIRGenFunction &cgf,
const CXXRecordDecl *vtableClass, BaseSubobject base,
161 const CXXRecordDecl *nearestVBase)
override {
163 "getVTableAddressPointInStructor: MSVC ABI");
167 CIRGenCallee getVirtualFunctionPointer(CIRGenFunction &cgf, GlobalDecl gd,
168 Address thisAddr, mlir::Type ty,
169 SourceLocation loc)
override {
170 cgf.
cgm.
errorNYI(loc,
"getVirtualFunctionPointer: MSVC ABI");
171 return CIRGenCallee();
174 void emitVTableDefinitions(CIRGenVTables &cgvt,
175 const CXXRecordDecl *rd)
override {
176 cgm.errorNYI(rd->
getSourceRange(),
"emitVTableDefinitions: MSVC ABI");
179 void emitVirtualInheritanceTables(
const CXXRecordDecl *rd)
override {
181 "emitVirtualInheritanceTables: MSVC ABI");
185 initializeHiddenVirtualInheritanceMembers(CIRGenFunction &cgf,
186 const CXXRecordDecl *rd)
override {
188 "initializeHiddenVirtualInheritanceMembers: MSVC ABI");
192 getVirtualBaseClassOffset(mlir::Location loc, CIRGenFunction &cgf,
193 Address thisAddr,
const CXXRecordDecl *classDecl,
194 const CXXRecordDecl *baseClassDecl)
override {
195 cgf.
cgm.
errorNYI(loc,
"getVirtualBaseClassOffset: MSVC ABI");
199 cir::MethodAttr buildVirtualMethodAttr(cir::MethodType methodTy,
200 const CXXMethodDecl *md)
override {
201 cgm.errorNYI(md->
getSourceRange(),
"buildVirtualMethodAttr: MSVC ABI");
202 return cir::MethodAttr();
205 mlir::Value performThisAdjustment(CIRGenFunction &cgf, Address thisAddr,
206 const CXXRecordDecl *unadjustedClass,
207 const ThunkInfo &ti)
override {
208 cgf.
cgm.
errorNYI(
"performThisAdjustment: MSVC ABI");
213 const CXXRecordDecl *unadjustedClass,
214 const ReturnAdjustment &ra)
override {
215 cgf.
cgm.
errorNYI(
"performReturnAdjustment: MSVC ABI");
219 bool canSpeculativelyEmitVTable(
const CXXRecordDecl *rd)
const override {
223 bool doStructorsInitializeVPtrs(
const CXXRecordDecl *vtableClass)
override {
225 "doStructorsInitializeVPtrs: MSVC ABI");
229 bool exportThunk()
override {
return false; }
231 bool useThunkForDtorVariant(
const CXXDestructorDecl *dtor,
233 cgm.errorNYI(dtor->
getSourceRange(),
"useThunkForDtorVariant: MSVC ABI");
237 void setThunkLinkage(cir::FuncOp thunk,
bool forVTable, GlobalDecl gd,
238 bool returnAdjustment)
override {
242 StringRef getPureVirtualCallName()
override {
return "_purecall"; }
243 StringRef getDeletedVirtualCallName()
override {
return "_purecall"; }
245 bool isZeroInitializable(
const MemberPointerType *mpt)
override {
246 cgm.errorNYI(
"isZeroInitializable: MSVC ABI");
250 bool requiresArrayCookie(
const CXXNewExpr *e)
override {
251 cgm.errorNYI(e->
getSourceRange(),
"requiresArrayCookie: MSVC ABI");
255 CharUnits getArrayCookieSizeImpl(QualType elementType)
override {
256 cgm.errorNYI(
"getArrayCookieSizeImpl: MSVC ABI");
260 Address initializeArrayCookie(CIRGenFunction &cgf, Address newPtr,
261 mlir::Value numElements,
const CXXNewExpr *e,
262 QualType elementType)
override {
267 bool shouldTypeidBeNullChecked(QualType srcTy)
override {
268 cgm.errorNYI(
"shouldTypeidBeNullChecked: MSVC ABI");
272 mlir::Value emitTypeid(CIRGenFunction &cgf, QualType srcTy, Address thisPtr,
273 mlir::Type typeInfoPtrTy)
override {
275 "emitTypeid: MSVC ABI");
280 void emitBadTypeidCall(CIRGenFunction &cgf, mlir::Location loc)
override {
281 cgf.
cgm.
errorNYI(loc,
"emitBadTypeidCall: MSVC ABI");
284 void emitBadCastCall(CIRGenFunction &cgf, mlir::Location loc)
override {
285 cgm.errorNYI(loc,
"emitBadCastCall: MSVC ABI");
288 mlir::Value emitDynamicCast(CIRGenFunction &cgf, mlir::Location loc,
289 QualType srcRecordTy, QualType destRecordTy,
290 cir::PointerType destCIRTy,
bool isRefCast,
291 Address src)
override {
292 cgf.
cgm.
errorNYI(loc,
"emitDynamicCast: MSVC ABI");
296 mlir::Attribute getAddrOfRTTIDescriptor(mlir::Location loc,
297 QualType ty)
override {
298 cgm.errorNYI(loc,
"getAddrOfRTTIDescriptor: MSVC ABI");
302 CatchTypeInfo getCatchAllTypeInfo()
override {
303 cgm.errorNYI(
"getCatchAllTypeInfo: MSVC ABI");
304 return CatchTypeInfo{
nullptr, 0};
308 getAddrOfCXXCatchHandlerType(mlir::Location loc, QualType ty,
309 QualType catchHandlerType)
override {
310 cgm.errorNYI(loc,
"getAddrOfCXXCatchHandlerType: MSVC ABI");
311 return CatchTypeInfo{
nullptr, 0};
314 void emitRethrow(CIRGenFunction &cgf,
bool isNoReturn)
override {
315 cgm.errorNYI(
"emitRethrow: MSVC ABI");
318 void emitThrow(CIRGenFunction &cgf,
const CXXThrowExpr *e)
override {
322 void registerGlobalDtor(
const VarDecl *vd, cir::FuncOp dtor,
323 mlir::Value addr)
override {
324 cgm.errorNYI(vd->
getSourceRange(),
"registerGlobalDtor: MSVC ABI");
331 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()
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.