================
@@ -538,6 +538,104 @@ void CIRGenFunction::emitConstructorBody(FunctionArgList
&args) {
}
}
+/// Emits the body of the current destructor.
+void CIRGenFunction::emitDestructorBody(FunctionArgList &args) {
+ const CXXDestructorDecl *dtor = cast<CXXDestructorDecl>(curGD.getDecl());
+ CXXDtorType dtorType = curGD.getDtorType();
+
+ // For an abstract class, non-base destructors are never used (and can't
+ // be emitted in general, because vbase dtors may not have been validated
+ // by Sema), but the Itanium ABI doesn't make them optional and Clang may
+ // in fact emit references to them from other compilations, so emit them
+ // as functions containing a trap instruction.
+ if (dtorType != Dtor_Base && dtor->getParent()->isAbstract()) {
+ SourceLocation loc =
----------------
andykaylor wrote:
It's probably not possible to write a test that hits this code yet. If that's
so, can you make it NYI until we can?
https://github.com/llvm/llvm-project/pull/144719
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits