diff options
author | Troy A. Johnson <troyj@cray.com> | 2019-08-17 04:20:24 +0000 |
---|---|---|
committer | Troy A. Johnson <troyj@cray.com> | 2019-08-17 04:20:24 +0000 |
commit | c0d70bca0f9f421db80c8e96a4b5dda12de46f2f (patch) | |
tree | d6b5234a3bf82cccccb959ea2ec5c37a6db786f0 /clang/lib | |
parent | ee6700f69766b57849f483f471387229e495e311 (diff) | |
download | bcm5719-llvm-c0d70bca0f9f421db80c8e96a4b5dda12de46f2f.tar.gz bcm5719-llvm-c0d70bca0f9f421db80c8e96a4b5dda12de46f2f.zip |
[X86] Support -mlong-double-80
Add an option group for all of the -mlong-double-* options and make
-mlong-double-80 restore the default long double behavior for X86. The
motivations are that GNU accepts the -mlong-double-80 option and that complex
Makefiles often need a way of undoing earlier options. Prior to this commit, if
one chooses 64-bit or 128-bit long double for X86, there is no way to undo that
choice and restore the 80-bit behavior.
Differential Revision: https://reviews.llvm.org/D66055
llvm-svn: 369183
Diffstat (limited to 'clang/lib')
-rw-r--r-- | clang/lib/Driver/ToolChains/Clang.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/clang/lib/Driver/ToolChains/Clang.cpp b/clang/lib/Driver/ToolChains/Clang.cpp index 2e9ccca4b29..690d4fa3fa4 100644 --- a/clang/lib/Driver/ToolChains/Clang.cpp +++ b/clang/lib/Driver/ToolChains/Clang.cpp @@ -4057,11 +4057,12 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA, RenderFloatingPointOptions(TC, D, OFastEnabled, Args, CmdArgs); - if (Arg *A = Args.getLastArg(options::OPT_mlong_double_64, - options::OPT_mlong_double_128)) { + if (Arg *A = Args.getLastArg(options::OPT_LongDouble_Group)) { if (TC.getArch() == llvm::Triple::x86 || - TC.getArch() == llvm::Triple::x86_64 || - TC.getArch() == llvm::Triple::ppc || TC.getTriple().isPPC64()) + TC.getArch() == llvm::Triple::x86_64) + A->render(Args, CmdArgs); + else if ((TC.getArch() == llvm::Triple::ppc || TC.getTriple().isPPC64()) && + (A->getOption().getID() != options::OPT_mlong_double_80)) A->render(Args, CmdArgs); else D.Diag(diag::err_drv_unsupported_opt_for_target) |