[PATCH] D59624: [Driver] Pass -malign-double from the driver to the cc1 command line

Craig Topper via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Mar 20 17:47:06 PDT 2019


craig.topper created this revision.
craig.topper added a reviewer: rnk.

-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.


https://reviews.llvm.org/D59624

Files:
  clang/lib/Driver/ToolChains/Clang.cpp
  clang/test/Driver/malign_double.c


Index: clang/test/Driver/malign_double.c
===================================================================
--- /dev/null
+++ clang/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"
Index: clang/lib/Driver/ToolChains/Clang.cpp
===================================================================
--- clang/lib/Driver/ToolChains/Clang.cpp
+++ clang/lib/Driver/ToolChains/Clang.cpp
@@ -4547,6 +4547,7 @@
   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");


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D59624.191613.patch
Type: text/x-patch
Size: 895 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20190321/91d1fddf/attachment.bin>


More information about the cfe-commits mailing list