From: Craig Topper Date: Thu, 21 Mar 2019 20:07:24 +0000 (+0000) Subject: [Driver] Pass -malign-double from the driver to the cc1 command line X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=10535f02fa4221be9866d5b5572b622025e149bb;p=clang [Driver] Pass -malign-double from the driver to the cc1 command line -malign-double is currently only implemented in the -cc1 interface. But its declared in Options.td so it is a driver option too. But you try to use it with the driver you'll get a message about the option being unused. This patch teaches the driver to pass the option through to cc1 so it won't be unused. The Options.td says the option is x86 only but I didn't see any x86 specific code in its impementation in cc1 so not sure if the documentation is wrong or if I should only pass this option through the driver on x86 targets. Differential Revision: https://reviews.llvm.org/D59624 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@356706 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Driver/ToolChains/Clang.cpp b/lib/Driver/ToolChains/Clang.cpp index bf9ab9dd10..20f55dff5a 100644 --- a/lib/Driver/ToolChains/Clang.cpp +++ b/lib/Driver/ToolChains/Clang.cpp @@ -4547,6 +4547,7 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA, Args.AddLastArg(CmdArgs, options::OPT_fdiagnostics_parseable_fixits); Args.AddLastArg(CmdArgs, options::OPT_ftime_report); Args.AddLastArg(CmdArgs, options::OPT_ftrapv); + Args.AddLastArg(CmdArgs, options::OPT_malign_double); if (Arg *A = Args.getLastArg(options::OPT_ftrapv_handler_EQ)) { CmdArgs.push_back("-ftrapv-handler"); diff --git a/test/Driver/malign_double.c b/test/Driver/malign_double.c new file mode 100644 index 0000000000..2c5cc35ea1 --- /dev/null +++ b/test/Driver/malign_double.c @@ -0,0 +1,5 @@ +// RUN: %clang -### -malign-double %s 2>&1 | FileCheck %s + +// Make sure -malign-double is passed through the driver. + +// CHECK: "-malign-double"