[clang][Driver] Expose -fexperimental-relative-c++-abi-vtables flag

Initially, this flag was meant to only be used through cc1 and not directly
through the clang driver. However, we accidentally ended up using this flag
as a driver flag already for selecting multilibs within the fuchsia toolchain.
We're currently in an awkward state where it's only accepted as a driver flag
when targeting Fuchsia, and all other instances it can only be added via
-Xclang. Since we're ready to use this in Fuchsia, we can just expose this to
the driver for simplicity.

Differential Revision: https://reviews.llvm.org/D98375
This commit is contained in:
Leonard Chan 2021-03-10 16:27:26 -08:00
parent af4ae18319
commit 70af0bf6fe
2 changed files with 10 additions and 0 deletions

View File

@ -4869,6 +4869,9 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
Args.AddLastArg(CmdArgs, options::OPT_ffine_grained_bitfield_accesses, Args.AddLastArg(CmdArgs, options::OPT_ffine_grained_bitfield_accesses,
options::OPT_fno_fine_grained_bitfield_accesses); options::OPT_fno_fine_grained_bitfield_accesses);
Args.AddLastArg(CmdArgs, options::OPT_fexperimental_relative_cxx_abi_vtables,
options::OPT_fno_experimental_relative_cxx_abi_vtables);
// Handle segmented stacks. // Handle segmented stacks.
if (Args.hasArg(options::OPT_fsplit_stack)) if (Args.hasArg(options::OPT_fsplit_stack))
CmdArgs.push_back("-split-stacks"); CmdArgs.push_back("-split-stacks");

View File

@ -0,0 +1,7 @@
// RUN: %clangxx --target=aarch64-unknown-fuchsia -fexperimental-relative-c++-abi-vtables -c %s -### 2>&1 | FileCheck %s --check-prefix=RV
// RUN: %clangxx --target=aarch64-unknown-fuchsia -fno-experimental-relative-c++-abi-vtables -c %s -### 2>&1 | FileCheck %s --check-prefix=NO-RV
// RUN: %clangxx --target=aarch64-unknown-fuchsia -c %s -### 2>&1 | FileCheck %s --check-prefix=NO-RV
// RUN: %clangxx --target=aarch64-unknown-linux-gnu -c %s -### 2>&1 | FileCheck %s --check-prefix=NO-RV
// RV: "-fexperimental-relative-c++-abi-vtables"
// NO-RV-NOT: "-fexperimental-relative-c++-abi-vtables"