]> granicus.if.org Git - clang/commitdiff
Driver: force restricted IT blocks for Windows on ARM
authorSaleem Abdulrasool <compnerd@compnerd.org>
Sun, 18 May 2014 06:42:02 +0000 (06:42 +0000)
committerSaleem Abdulrasool <compnerd@compnerd.org>
Sun, 18 May 2014 06:42:02 +0000 (06:42 +0000)
Windows on ARM expects ARMv8 (restricted IT) conditional instructions only.
Force enable the restricted IT mode via the backend option when targeting WoA.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209086 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Driver/Tools.cpp
test/Driver/woa-restrict-it.c [new file with mode: 0644]

index b0425cbe08a7540a45d950a16fd9c4ccfaf0cb05..7862ffb446e2cbadf49b664abaea60191b95c76d 100644 (file)
@@ -3451,6 +3451,11 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
       CmdArgs.push_back("-backend-option");
       CmdArgs.push_back("-arm-no-restrict-it");
     }
+  } else if (TT.isOSWindows() && (TT.getArch() == llvm::Triple::arm ||
+                                  TT.getArch() == llvm::Triple::thumb)) {
+    // Windows on ARM expects restricted IT blocks
+    CmdArgs.push_back("-backend-option");
+    CmdArgs.push_back("-arm-restrict-it");
   }
 
   // Forward -f options with positive and negative forms; we translate
diff --git a/test/Driver/woa-restrict-it.c b/test/Driver/woa-restrict-it.c
new file mode 100644 (file)
index 0000000..c046991
--- /dev/null
@@ -0,0 +1,4 @@
+// RUN: %clang -target armv7-windows -### %s 2>&1 | FileCheck %s
+
+// CHECK: "-backend-option" "-arm-restrict-it"
+