-
Notifications
You must be signed in to change notification settings - Fork 15.3k
[MS][clang] Add support for vector deleting destructors #126240
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
04636be
42cf015
f715d55
5f87402
736ccf9
a26d7b8
474bf1e
252cd7f
6e927db
5f87ab5
a3eb446
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1733,8 +1733,8 @@ void ItaniumVTableBuilder::LayoutPrimaryAndSecondaryVTables( | |
| const CXXMethodDecl *MD = I.first; | ||
| const MethodInfo &MI = I.second; | ||
| if (const CXXDestructorDecl *DD = dyn_cast<CXXDestructorDecl>(MD)) { | ||
| MethodVTableIndices[GlobalDecl(DD, Dtor_Complete)] | ||
| = MI.VTableIndex - AddressPoint; | ||
| MethodVTableIndices[GlobalDecl(DD, Dtor_Complete)] = | ||
| MI.VTableIndex - AddressPoint; | ||
| MethodVTableIndices[GlobalDecl(DD, Dtor_Deleting)] | ||
| = MI.VTableIndex + 1 - AddressPoint; | ||
| } else { | ||
|
|
@@ -2655,7 +2655,10 @@ class VFTableBuilder { | |
| MethodVFTableLocation Loc(MI.VBTableIndex, WhichVFPtr.getVBaseWithVPtr(), | ||
| WhichVFPtr.NonVirtualOffset, MI.VFTableIndex); | ||
| if (const CXXDestructorDecl *DD = dyn_cast<CXXDestructorDecl>(MD)) { | ||
| MethodVFTableLocations[GlobalDecl(DD, Dtor_Deleting)] = Loc; | ||
| if (!Context.getTargetInfo().getCXXABI().isMicrosoft()) | ||
|
||
| MethodVFTableLocations[GlobalDecl(DD, Dtor_Deleting)] = Loc; | ||
| else | ||
| MethodVFTableLocations[GlobalDecl(DD, Dtor_VectorDeleting)] = Loc; | ||
| } else { | ||
| MethodVFTableLocations[MD] = Loc; | ||
| } | ||
|
|
@@ -3285,7 +3288,10 @@ void VFTableBuilder::dumpLayout(raw_ostream &Out) { | |
| const CXXDestructorDecl *DD = Component.getDestructorDecl(); | ||
|
|
||
| DD->printQualifiedName(Out); | ||
| Out << "() [scalar deleting]"; | ||
| if (Context.getTargetInfo().getCXXABI().isMicrosoft()) | ||
| Out << "() [vector deleting]"; | ||
| else | ||
| Out << "() [scalar deleting]"; | ||
|
|
||
| if (DD->isPureVirtual()) | ||
| Out << " [pure]"; | ||
|
|
@@ -3756,7 +3762,7 @@ void MicrosoftVTableContext::dumpMethodLocations( | |
| PredefinedIdentKind::PrettyFunctionNoVirtual, MD); | ||
|
|
||
| if (isa<CXXDestructorDecl>(MD)) { | ||
| IndicesMap[I.second] = MethodName + " [scalar deleting]"; | ||
| IndicesMap[I.second] = MethodName + " [vector deleting]"; | ||
| } else { | ||
| IndicesMap[I.second] = MethodName; | ||
| } | ||
|
|
@@ -3873,7 +3879,7 @@ MicrosoftVTableContext::getMethodVFTableLocation(GlobalDecl GD) { | |
| assert(hasVtableSlot(cast<CXXMethodDecl>(GD.getDecl())) && | ||
| "Only use this method for virtual methods or dtors"); | ||
| if (isa<CXXDestructorDecl>(GD.getDecl())) | ||
| assert(GD.getDtorType() == Dtor_Deleting); | ||
| assert(GD.getDtorType() == Dtor_VectorDeleting); | ||
|
|
||
| GD = GD.getCanonicalDecl(); | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -251,9 +251,10 @@ class CGCXXABI { | |
|
|
||
| public: | ||
| virtual void emitVirtualObjectDelete(CodeGenFunction &CGF, | ||
| const CXXDeleteExpr *DE, | ||
| Address Ptr, QualType ElementType, | ||
| const CXXDestructorDecl *Dtor) = 0; | ||
| const CXXDeleteExpr *DE, Address Ptr, | ||
| QualType ElementType, | ||
| const CXXDestructorDecl *Dtor, | ||
| bool ArrayDeletion) = 0; | ||
| virtual void emitRethrow(CodeGenFunction &CGF, bool isNoReturn) = 0; | ||
| virtual void emitThrow(CodeGenFunction &CGF, const CXXThrowExpr *E) = 0; | ||
| virtual llvm::GlobalVariable *getThrowInfo(QualType T) { return nullptr; } | ||
|
|
@@ -275,6 +276,7 @@ class CGCXXABI { | |
| virtual CatchTypeInfo getCatchAllTypeInfo(); | ||
|
|
||
| virtual bool shouldTypeidBeNullChecked(QualType SrcRecordTy) = 0; | ||
| virtual bool hasVectorDeletingDtors() = 0; | ||
| virtual void EmitBadTypeidCall(CodeGenFunction &CGF) = 0; | ||
| virtual llvm::Value *EmitTypeid(CodeGenFunction &CGF, QualType SrcRecordTy, | ||
| Address ThisPtr, | ||
|
|
@@ -485,11 +487,10 @@ class CGCXXABI { | |
| llvm::PointerUnion<const CXXDeleteExpr *, const CXXMemberCallExpr *>; | ||
|
|
||
| /// Emit the ABI-specific virtual destructor call. | ||
| virtual llvm::Value * | ||
| EmitVirtualDestructorCall(CodeGenFunction &CGF, const CXXDestructorDecl *Dtor, | ||
| CXXDtorType DtorType, Address This, | ||
| DeleteOrMemberCallExpr E, | ||
| llvm::CallBase **CallOrInvoke) = 0; | ||
| virtual llvm::Value *EmitVirtualDestructorCall( | ||
| CodeGenFunction &CGF, const CXXDestructorDecl *Dtor, CXXDtorType DtorType, | ||
| Address This, DeleteOrMemberCallExpr E, llvm::CallBase **CallOrInvoke, | ||
| bool ArrayDeletion = false) = 0; | ||
|
|
||
| virtual void adjustCallArgsForDestructorThunk(CodeGenFunction &CGF, | ||
| GlobalDecl GD, | ||
|
|
@@ -575,6 +576,12 @@ class CGCXXABI { | |
| QualType ElementType, llvm::Value *&NumElements, | ||
| llvm::Value *&AllocPtr, CharUnits &CookieSize); | ||
|
|
||
| /// Reads the array cookie associated with the given pointer, | ||
| /// that should have one. | ||
| virtual void ReadArrayCookie(CodeGenFunction &CGF, Address Ptr, | ||
|
||
| QualType ElementType, llvm::Value *&NumElements, | ||
| llvm::Value *&AllocPtr, CharUnits &CookieSize); | ||
|
|
||
| /// Return whether the given global decl needs a VTT parameter. | ||
| virtual bool NeedsVTTParameter(GlobalDecl GD); | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.