From e6f88dc01a7208b6f4671c4fcb5d9e68d0808a34 Mon Sep 17 00:00:00 2001 From: Leonard Chan Date: Wed, 12 May 2021 10:37:37 -0700 Subject: [clang][Fuchsia] Turn on relative-vtables by default for Fuchsia All fuchsia targets will now use the relative-vtables ABI by default. Also remove -fexperimental-relative-c++-abi-vtables from test RUNs targeting fuchsia. Differential Revision: https://reviews.llvm.org/D102374 --- clang/lib/Frontend/CompilerInvocation.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'clang/lib/Frontend/CompilerInvocation.cpp') diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp index 28cd839..24f8998 100644 --- a/clang/lib/Frontend/CompilerInvocation.cpp +++ b/clang/lib/Frontend/CompilerInvocation.cpp @@ -3529,6 +3529,11 @@ void CompilerInvocation::GenerateLangArgs(const LangOptions &Opts, if (Opts.CXXABI) GenerateArg(Args, OPT_fcxx_abi_EQ, TargetCXXABI::getSpelling(*Opts.CXXABI), SA); + + if (Opts.RelativeCXXABIVTables) + GenerateArg(Args, OPT_fexperimental_relative_cxx_abi_vtables, SA); + else + GenerateArg(Args, OPT_fno_experimental_relative_cxx_abi_vtables, SA); } bool CompilerInvocation::ParseLangArgs(LangOptions &Opts, ArgList &Args, @@ -4039,6 +4044,11 @@ bool CompilerInvocation::ParseLangArgs(LangOptions &Opts, ArgList &Args, } } + Opts.RelativeCXXABIVTables = + Args.hasFlag(options::OPT_fexperimental_relative_cxx_abi_vtables, + options::OPT_fno_experimental_relative_cxx_abi_vtables, + TargetCXXABI::usesRelativeVTables(T)); + return Diags.getNumErrors() == NumErrorsBefore; } -- cgit v1.1