Check attributes in @abi attr

This commit compares the attributes on the decl inside the `@abi` attribute to those in the decl it’s attached to, diagnosing ABI-incompatible differences. It also rejects many attributes that don’t need to be specified in the `@abi` attribute, such as ObjC-ness, access control, or ABI-neutral traits like `@discardableResult`, so developers know to remove them.
This commit is contained in:
Becca Royal-Gordon
2025-03-19 14:28:07 -07:00
parent 32b8a11b11
commit 132f49108d
11 changed files with 1574 additions and 6 deletions

View File

@@ -1422,6 +1422,8 @@ static bool ParseLangArgs(LangOptions &Opts, ArgList &Args,
Opts.EnableSkipExplicitInterfaceModuleBuildRemarks = Args.hasArg(OPT_remark_skip_explicit_interface_build);
Opts.EnableABIInferenceRemarks = Args.hasArg(OPT_remark_abi_inference);
if (Args.hasArg(OPT_experimental_skip_non_exportable_decls)) {
// Only allow -experimental-skip-non-exportable-decls if either library
// evolution is enabled (in which case the module's ABI is independent of