================
@@ -1518,6 +1518,50 @@ static void verifyDiagnosticWording(const Record &Diag) {
   // runs into odd situations like [[clang::warn_unused_result]],
   // #pragma clang, or --unwindlib=libgcc.
 }
+
+/// ClangDiagsCompatIDsEmitter - Emit a set of 'compatibility diagnostic ids'
+/// that map to a set of 2 regular diagnostic ids each and which are used to
+/// simplify emitting compatibility warnings.
+void clang::EmitClangDiagsCompatIDs(const llvm::RecordKeeper &Records,
----------------
Sirraide wrote:

Sure, e.g. for `DiagnosticSemaCompatIDs.inc`, this generates:
```console
DIAG_COMPAT_IDS_BEGIN()
DIAG_COMPAT_ID(1,nonclass_type_friend,11,compat_cxx11_nonclass_type_friend,compat_pre_cxx11_nonclass_type_friend)
DIAG_COMPAT_ID(2,static_data_member_in_union,11,compat_cxx11_static_data_member_in_union,compat_pre_cxx11_static_data_member_in_union)
DIAG_COMPAT_ID(3,templ_default_in_function_templ,11,compat_cxx11_templ_default_in_function_templ,compat_pre_cxx11_templ_default_in_function_templ)
DIAG_COMPAT_ID(4,template_arg_extra_parens,11,compat_cxx11_template_arg_extra_parens,compat_pre_cxx11_template_arg_extra_parens)
DIAG_COMPAT_ID(5,typename_outside_of_template,11,compat_cxx11_typename_outside_of_template,compat_pre_cxx11_typename_outside_of_template)
DIAG_COMPAT_ID(6,constexpr_type_definition,14,compat_cxx14_constexpr_type_definition,compat_pre_cxx14_constexpr_type_definition)
DIAG_COMPAT_ID(7,constexpr_local_var,14,compat_cxx14_constexpr_local_var,compat_pre_cxx14_constexpr_local_var)
DIAG_COMPAT_ID(8,constexpr_body_multiple_return,14,compat_cxx14_constexpr_body_multiple_return,compat_pre_cxx14_constexpr_body_multiple_return)
DIAG_COMPAT_ID(9,variable_template,14,compat_cxx14_variable_template,compat_pre_cxx14_variable_template)
DIAG_COMPAT_ID(10,decomp_decl,17,compat_cxx17_decomp_decl,compat_pre_cxx17_decomp_decl)
DIAG_COMPAT_ID(11,inline_variable,17,compat_cxx17_inline_variable,compat_pre_cxx17_inline_variable)
DIAG_COMPAT_ID(12,decomp_decl_spec,20,compat_cxx20_decomp_decl_spec,compat_pre_cxx20_decomp_decl_spec)
DIAG_COMPAT_ID(13,constexpr_local_var_no_init,20,compat_cxx20_constexpr_local_var_no_init,compat_pre_cxx20_constexpr_local_var_no_init)
DIAG_COMPAT_ID(14,constexpr_function_try_block,20,compat_cxx20_constexpr_function_try_block,compat_pre_cxx20_constexpr_function_try_block)
DIAG_COMPAT_ID(15,constexpr_union_ctor_no_init,20,compat_cxx20_constexpr_union_ctor_no_init,compat_pre_cxx20_constexpr_union_ctor_no_init)
DIAG_COMPAT_ID(16,constexpr_ctor_missing_init,20,compat_cxx20_constexpr_ctor_missing_init,compat_pre_cxx20_constexpr_ctor_missing_init)
DIAG_COMPAT_ID(17,adl_only_template_id,20,compat_cxx20_adl_only_template_id,compat_pre_cxx20_adl_only_template_id)
DIAG_COMPAT_ID(18,constexpr_static_var,23,compat_cxx23_constexpr_static_var,compat_pre_cxx23_constexpr_static_var)
DIAG_COMPAT_ID(19,decomp_decl_cond,26,compat_cxx26_decomp_decl_cond,compat_pre_cxx26_decomp_decl_cond)
DIAG_COMPAT_ID(20,cxx14_constexpr_body_invalid_stmt,14,compat_cxx14_cxx14_constexpr_body_invalid_stmt,compat_pre_cxx14_cxx14_constexpr_body_invalid_stmt)
DIAG_COMPAT_ID(21,cxx20_constexpr_body_invalid_stmt,20,compat_cxx20_cxx20_constexpr_body_invalid_stmt,compat_pre_cxx20_cxx20_constexpr_body_invalid_stmt)
DIAG_COMPAT_ID(22,cxx23_constexpr_body_invalid_stmt,23,compat_cxx23_cxx23_constexpr_body_invalid_stmt,compat_pre_cxx23_cxx23_constexpr_body_invalid_stmt)
DIAG_COMPAT_IDS_END()
```

https://github.com/llvm/llvm-project/pull/132348
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to