aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Frontend/CompilerInvocation.cpp
diff options
context:
space:
mode:
authorDouglas Yung <douglas.yung@sony.com>2020-10-19 18:17:34 -0700
committerDouglas Yung <douglas.yung@sony.com>2020-10-19 18:17:34 -0700
commit774ab60125eeaeac8bf2470b7aaa6aa428d68453 (patch)
tree9547a7f3259561d4d1fb6f47f9bbfad7b69d99c6 /clang/lib/Frontend/CompilerInvocation.cpp
parentae9d0400283229032fb3795b7b50920bf9be38dc (diff)
downloadllvm-774ab60125eeaeac8bf2470b7aaa6aa428d68453.zip
llvm-774ab60125eeaeac8bf2470b7aaa6aa428d68453.tar.gz
llvm-774ab60125eeaeac8bf2470b7aaa6aa428d68453.tar.bz2
Add option to use older clang ABI behavior when passing certain union types as function arguments
Recently commit D78699 (commit 26cfb6e562f1), fixed clang's behavior with respect to passing a union type through a register to correctly follow the ABI. However, this is an ABI breaking change with earlier versions of the clang compiler, so we should add an -fclang-abi-compat option to address this. Additionally, the PS4 ABI requires the older behavior, so that is added as well. This change adds a Ver11 value to the ClangABI enum that when it is set (or the target is the PS4 triple), we skip the ABI fix introduced in D78699. Differential Revision: https://reviews.llvm.org/D89747
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
-rw-r--r--clang/lib/Frontend/CompilerInvocation.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp
index c518606..7cbd5b3 100644
--- a/clang/lib/Frontend/CompilerInvocation.cpp
+++ b/clang/lib/Frontend/CompilerInvocation.cpp
@@ -3460,6 +3460,8 @@ static void ParseLangArgs(LangOptions &Opts, ArgList &Args, InputKind IK,
Opts.setClangABICompat(LangOptions::ClangABI::Ver7);
else if (Major <= 9)
Opts.setClangABICompat(LangOptions::ClangABI::Ver9);
+ else if (Major <= 11)
+ Opts.setClangABICompat(LangOptions::ClangABI::Ver11);
} else if (Ver != "latest") {
Diags.Report(diag::err_drv_invalid_value)
<< A->getAsString(Args) << A->getValue();