aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Frontend/CompilerInvocation.cpp
diff options
context:
space:
mode:
authorFangrui Song <maskray@google.com>2019-07-09 00:27:43 +0000
committerFangrui Song <maskray@google.com>2019-07-09 00:27:43 +0000
commit11cb39c5fc52e59c155be9b8fedbd114a596891b (patch)
treee6de4edf00ad775200d79c6d6b84f2f3bf2ae0e2 /clang/lib/Frontend/CompilerInvocation.cpp
parent9801621616b2eaac6839c144095d8e479385566a (diff)
downloadllvm-11cb39c5fc52e59c155be9b8fedbd114a596891b.zip
llvm-11cb39c5fc52e59c155be9b8fedbd114a596891b.tar.gz
llvm-11cb39c5fc52e59c155be9b8fedbd114a596891b.tar.bz2
[X86][PPC] Support -mlong-double-64
-mlong-double-64 is supported on some ports of gcc (i386, x86_64, and ppc{32,64}). On many other targets, there will be an error: error: unrecognized command line option '-mlong-double-64' This patch makes the driver option -mlong-double-64 available for x86 and ppc. The CC1 option -mlong-double-64 is available on all targets for users to test on unsupported targets. LongDoubleSize is added as a VALUE_LANGOPT so that the option can be shared with -mlong-double-128 when we support it in clang. Also, make powerpc*-linux-musl default to use 64-bit long double. It is currently the only supported ABI on musl and is also how people configure powerpc*-linux-musl-gcc. Reviewed By: rnk Differential Revision: https://reviews.llvm.org/D64067 llvm-svn: 365412
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
-rw-r--r--clang/lib/Frontend/CompilerInvocation.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp
index e5ea409..0d9e29d 100644
--- a/clang/lib/Frontend/CompilerInvocation.cpp
+++ b/clang/lib/Frontend/CompilerInvocation.cpp
@@ -2742,6 +2742,7 @@ static void ParseLangArgs(LangOptions &Opts, ArgList &Args, InputKind IK,
Opts.PackStruct = getLastArgIntValue(Args, OPT_fpack_struct_EQ, 0, Diags);
Opts.MaxTypeAlign = getLastArgIntValue(Args, OPT_fmax_type_align_EQ, 0, Diags);
Opts.AlignDouble = Args.hasArg(OPT_malign_double);
+ Opts.LongDoubleSize = Args.hasArg(OPT_mlong_double_64) ? 64 : 0;
Opts.PICLevel = getLastArgIntValue(Args, OPT_pic_level, 0, Diags);
Opts.ROPI = Args.hasArg(OPT_fropi);
Opts.RWPI = Args.hasArg(OPT_frwpi);