================
@@ -1681,11 +1681,16 @@ void CIRGenItaniumCXXABI::emitThrow(CIRGenFunction &cgf,
   CharUnits exnAlign = cgf.getContext().getExnObjectAlignment();
   cgf.emitAnyExprToExn(e->getSubExpr(), Address(exceptionPtr, exnAlign));
 
-  // Get the RTTI symbol address.
-  auto typeInfo = mlir::cast<cir::GlobalViewAttr>(
+  // Materialize the RTTI address as an SSA value. Device compilation may
+  // suppress RTTI emission, in which case this is a typed null pointer in the
+  // target's global address space instead of a view of an RTTI global.
+  auto typeInfoAttr = mlir::cast<mlir::TypedAttr>(
       cgm.getAddrOfRTTIDescriptor(subExprLoc, clangThrowType,
                                   /*forEH=*/true));
-  assert(!typeInfo.getIndices() && "expected no indirection");
+  if (auto globalView = mlir::dyn_cast<cir::GlobalViewAttr>(typeInfoAttr))
----------------
xakep8 wrote:

This makes perfect sense I was only accounting for the null RTTI and totally 
missed this part, thanks for the catch. I have moved the RTTI globals and refs 
to global address space this also needed some changes to the vtable and 
lowering paths.

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

Reply via email to