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

Shafik Yaghmour via cfe-commits cfe-commits at lists.llvm.org
Sun Oct 1 19:12:08 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)
----------------
shafik wrote:

It looks like we have one other case we can replace as well: https://github.com/llvm/llvm-project/blob/97829935844e7f35216e12c13231f35fbea640c3/clang/lib/AST/ItaniumMangle.cpp#L4728

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


More information about the cfe-commits mailing list