[clang] [Clang] Add __datasizeof (PR #67805)

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Fri Oct 13 11:19:54 PDT 2023


================
@@ -5038,19 +5039,19 @@ void CXXNameMangler::mangleExpression(const Expr *E, unsigned Arity,
       Out << 'a';
       MangleAlignofSizeofArg();
       break;
+    case UETT_DataSizeOf: {
+      Context.getDiags().Report(diag::err_cannot_mangle_expression)
+          << "__datasizeof";
+      return;
+    }
     case UETT_VecStep: {
-      DiagnosticsEngine &Diags = Context.getDiags();
-      unsigned DiagID = Diags.getCustomDiagID(DiagnosticsEngine::Error,
-                                     "cannot yet mangle vec_step expression");
-      Diags.Report(DiagID);
+      Context.getDiags().Report(diag::err_cannot_mangle_expression)
+          << "vec_step";
       return;
     }
     case UETT_OpenMPRequiredSimdAlign: {
-      DiagnosticsEngine &Diags = Context.getDiags();
-      unsigned DiagID = Diags.getCustomDiagID(
-          DiagnosticsEngine::Error,
-          "cannot yet mangle __builtin_omp_required_simd_align expression");
-      Diags.Report(DiagID);
+      Context.getDiags().Report(diag::err_cannot_mangle_expression)
----------------
AaronBallman wrote:

I think we should keep the more verbose form as it's more of a clear signal to the reader "this is weird and needs to be fixed". (These diagnostics are also strange in that they're not associated with a source location, which looks like a bug but isn't really one because we expect these diagnostics to go away at some point.)

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


More information about the cfe-commits mailing list