[PATCH] D15899: Add -fno-movt frontend option, to disable movt/movw on ARM

Dimitry Andric via cfe-commits cfe-commits at lists.llvm.org
Tue Jan 5 14:08:56 PST 2016


dim updated this revision to Diff 44059.
dim added a comment.

Rename `-fno-movt` to `-mno-movt`.


http://reviews.llvm.org/D15899

Files:
  include/clang/Driver/Options.td
  lib/Driver/Tools.cpp
  test/Driver/arm-no-movt.c

Index: test/Driver/arm-no-movt.c
===================================================================
--- test/Driver/arm-no-movt.c
+++ test/Driver/arm-no-movt.c
@@ -4,11 +4,11 @@
 // RUN: %clang -target armv7-apple-darwin -mkernel -### %s 2>&1 \
 // RUN:    | FileCheck %s -check-prefix CHECK-KERNEL
 
-// RUN: %clang -target armv7-gnueabi-freebsd11 -### %s 2>&1 \
-// RUN:    | FileCheck %s -check-prefix CHECK-FREEBSD
+// RUN: %clang -target armv7-none-gnueabi -mno-movt -### %s 2>&1 \
+// RUN:    | FileCheck %s -check-prefix CHECK-NO-MOVT
 
 // CHECK-DEFAULT-NOT: "-target-feature" "+no-movt"
 
 // CHECK-KERNEL: "-target-feature" "+no-movt"
 
-// CHECK-FREEBSD: "-target-feature" "+no-movt"
+// CHECK-NO-MOVT: "-target-feature" "+no-movt"
Index: lib/Driver/Tools.cpp
===================================================================
--- lib/Driver/Tools.cpp
+++ lib/Driver/Tools.cpp
@@ -938,8 +938,8 @@
   if (Args.hasArg(options::OPT_ffixed_r9))
     Features.push_back("+reserve-r9");
 
-  // The kext and FreeBSD linkers don't know how to deal with movw/movt.
-  if (KernelOrKext || Triple.isOSFreeBSD())
+  // The kext linker doesn't know how to deal with movw/movt.
+  if (KernelOrKext || Args.hasArg(options::OPT_mno_movt))
     Features.push_back("+no-movt");
 }
 
Index: include/clang/Driver/Options.td
===================================================================
--- include/clang/Driver/Options.td
+++ include/clang/Driver/Options.td
@@ -1385,6 +1385,8 @@
 def marm : Flag<["-"], "marm">, Alias<mno_thumb>;
 def ffixed_r9 : Flag<["-"], "ffixed-r9">, Group<m_arm_Features_Group>,
   HelpText<"Reserve the r9 register (ARM only)">;
+def mno_movt : Flag<["-"], "mno-movt">, Group<m_arm_Features_Group>,
+  HelpText<"Disallow use of movt/movw pairs (ARM only)">;
 def mcrc : Flag<["-"], "mcrc">, Group<m_arm_Features_Group>,
   HelpText<"Allow use of CRC instructions (ARM only)">;
 def mnocrc : Flag<["-"], "mnocrc">, Group<m_arm_Features_Group>,


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D15899.44059.patch
Type: text/x-patch
Size: 1968 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20160105/4ddc5775/attachment-0001.bin>


More information about the cfe-commits mailing list