[clang] [CIR] Relative vtable layout for virtual base offset (PR #195025)

Andy Kaylor via cfe-commits cfe-commits at lists.llvm.org
Fri May 1 12:44:25 PDT 2026


================
@@ -2057,8 +2057,11 @@ mlir::Value CIRGenItaniumCXXABI::getVirtualBaseClassOffset(
 
   mlir::Value vbaseOffset;
   if (cgm.getLangOpts().RelativeCXXABIVTables) {
-    assert(!cir::MissingFeatures::vtableRelativeLayout());
-    cgm.errorNYI(loc, "getVirtualBaseClassOffset: relative layout");
+    mlir::Value offsetPtr = builder.createBitcast(
----------------
andykaylor wrote:

This isn't nearly sufficient for relative vtable layout support. Search the code for `assert(!cir::MissingFeatures::vtableRelativeLayout());` and you'll find the other places that would need to be updated.

I'm concerned about having this one place where the feature is implemented while it is silently missing in many other places. At the very least, I would want to be reporting a diagnostic in all the places where it is missing.

https://github.com/llvm/llvm-project/pull/195025


More information about the cfe-commits mailing list