Author: ctopper Date: Thu Mar 21 13:07:24 2019 New Revision: 356706 URL: http://llvm.org/viewvc/llvm-project?rev=356706&view=rev Log: [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 Added: cfe/trunk/test/Driver/malign_double.c (with props) Modified: cfe/trunk/lib/Driver/ToolChains/Clang.cpp Modified: cfe/trunk/lib/Driver/ToolChains/Clang.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/Clang.cpp?rev=356706&r1=356705&r2=356706&view=diff ============================================================================== --- cfe/trunk/lib/Driver/ToolChains/Clang.cpp (original) +++ cfe/trunk/lib/Driver/ToolChains/Clang.cpp Thu Mar 21 13:07:24 2019 @@ -4547,6 +4547,7 @@ void Clang::ConstructJob(Compilation &C, 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"); Added: cfe/trunk/test/Driver/malign_double.c URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/malign_double.c?rev=356706&view=auto ============================================================================== --- cfe/trunk/test/Driver/malign_double.c (added) +++ cfe/trunk/test/Driver/malign_double.c Thu Mar 21 13:07:24 2019 @@ -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" Propchange: cfe/trunk/test/Driver/malign_double.c ------------------------------------------------------------------------------ svn:eol-style = native Propchange: cfe/trunk/test/Driver/malign_double.c ------------------------------------------------------------------------------ svn:keywords = Author Date Id Rev URL Propchange: cfe/trunk/test/Driver/malign_double.c ------------------------------------------------------------------------------ svn:mime-type = text/plain _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits