================
@@ -1430,14 +1431,20 @@ RValue CIRGenFunction::emitCall(const 
CIRGenFunctionInfo &funcInfo,
       return getUndefRValue(retTy);
     }
 
-    // Musttail is required to return immediately. Classic codegen does some
-    // work here to go through the exception handling scopes to put them before
-    // the call (it seems?) since musttail must be the last op before the
-    // return.  For now, skip this so we an do it later.
-    if (ehStack.stable_begin() != prologueCleanupDepth) {
-      cgm.errorNYI(mustTailCall->getBeginLoc(),
-                   "musttail call that skips cleanups");
-      return getUndefRValue(retTy);
+    // Musttail is required to return immediately, so no cleanup can run
+    // between the call and the return. Cleanups that the return makes
+    // unnecessary are simply skipped. Anything else cannot be expressed.
+    assert(!cir::MissingFeatures::dynamicExceptionSpec());
+    assert(!cir::MissingFeatures::fakeUseCleanup());
----------------
erichkeane wrote:

Classic does a diagnostic here, right?  It emits a 
`diag::err_musttail_noexcept_mismatch` I think.  Is that covered in one of the 
'missing features'? 

https://github.com/llvm/llvm-project/pull/224169
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to