From fed7be096f8ed5d70029acd712ac19ffc61e04e5 Mon Sep 17 00:00:00 2001 From: Harald van Dijk Date: Mon, 2 May 2022 18:07:47 +0100 Subject: Mark identifier prefixes as substitutable The Itanium C++ ABI says prefixes are substitutable. For most prefixes we already handle this: the manglePrefix(const DeclContext *, bool) and manglePrefix(QualType) overloads explicitly handles substitutions or defer to functions that handle substitutions on their behalf. The manglePrefix(NestedNameSpecifier *) overload, however, is different and handles some cases implicitly, but not all. The Identifier case was not handled; this change adds handling for it, as well as a test case. Reviewed By: erichkeane Differential Revision: https://reviews.llvm.org/D122663 --- clang/lib/Frontend/CompilerInvocation.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'clang/lib/Frontend/CompilerInvocation.cpp') diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp index b35e3f4..847766a 100644 --- a/clang/lib/Frontend/CompilerInvocation.cpp +++ b/clang/lib/Frontend/CompilerInvocation.cpp @@ -3518,6 +3518,8 @@ void CompilerInvocation::GenerateLangArgs(const LangOptions &Opts, GenerateArg(Args, OPT_fclang_abi_compat_EQ, "12.0", SA); else if (Opts.getClangABICompat() == LangOptions::ClangABI::Ver13) GenerateArg(Args, OPT_fclang_abi_compat_EQ, "13.0", SA); + else if (Opts.getClangABICompat() == LangOptions::ClangABI::Ver14) + GenerateArg(Args, OPT_fclang_abi_compat_EQ, "14.0", SA); if (Opts.getSignReturnAddressScope() == LangOptions::SignReturnAddressScopeKind::All) @@ -4026,6 +4028,8 @@ bool CompilerInvocation::ParseLangArgs(LangOptions &Opts, ArgList &Args, Opts.setClangABICompat(LangOptions::ClangABI::Ver12); else if (Major <= 13) Opts.setClangABICompat(LangOptions::ClangABI::Ver13); + else if (Major <= 14) + Opts.setClangABICompat(LangOptions::ClangABI::Ver14); } else if (Ver != "latest") { Diags.Report(diag::err_drv_invalid_value) << A->getAsString(Args) << A->getValue(); -- cgit v1.1