aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Frontend/CompilerInvocation.cpp
diff options
context:
space:
mode:
authorLeonard Chan <leonardchan@google.com>2021-05-12 10:37:37 -0700
committerLeonard Chan <leonardchan@google.com>2021-06-01 15:46:09 -0700
commite6f88dc01a7208b6f4671c4fcb5d9e68d0808a34 (patch)
tree6f2e30000fe8fa02cbe1767b0772a66dea0ddd3e /clang/lib/Frontend/CompilerInvocation.cpp
parentcf49cae278b4e972cd2547d72f9ee7d9d69a3af4 (diff)
downloadllvm-e6f88dc01a7208b6f4671c4fcb5d9e68d0808a34.zip
llvm-e6f88dc01a7208b6f4671c4fcb5d9e68d0808a34.tar.gz
llvm-e6f88dc01a7208b6f4671c4fcb5d9e68d0808a34.tar.bz2
[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
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
-rw-r--r--clang/lib/Frontend/CompilerInvocation.cpp10
1 files changed, 10 insertions, 0 deletions
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;
}