Skip to content

[clang] Improve ABI version handling in clang #144332

Open
@Fznamznon

Description

@Fznamznon

We have a language option for ABI-compatibility. The user may choose clang release version to generate code compatible with using flag -fclang-abi-compat= . Currently to bring a new version of known ABI, at least 3 different places need to be modified:

  1. Add new value to the langopt enum:
  2. Make sure it is handled here
    GenerateArg(Consumer, OPT_fclang_abi_compat_EQ, "20.0");
  3. Make sure it is parsed correctly here
    Opts.setClangABICompat(LangOptions::ClangABI::Ver20);

So, it is at least 3 places that need to be updated every ~6 months when new release is branched. Some of the places are super easy to forget which will cause build fails or bugs like the bug resolved by #144109 several months after ClangABI::Ver20 was introduced.

It would be great to improve this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    clangClang issues not falling into any other categoryenhancementImproving things as opposed to bug fixing, e.g. new or missing feature

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions