r209086 - Driver: force restricted IT blocks for Windows on ARM

Saleem Abdulrasool compnerd at compnerd.org
Sat May 17 23:42:03 PDT 2014


Author: compnerd
Date: Sun May 18 01:42:02 2014
New Revision: 209086

URL: http://llvm.org/viewvc/llvm-project?rev=209086&view=rev
Log:
Driver: force restricted IT blocks for Windows on ARM

Windows on ARM expects ARMv8 (restricted IT) conditional instructions only.
Force enable the restricted IT mode via the backend option when targeting WoA.

Added:
    cfe/trunk/test/Driver/woa-restrict-it.c
Modified:
    cfe/trunk/lib/Driver/Tools.cpp

Modified: cfe/trunk/lib/Driver/Tools.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=209086&r1=209085&r2=209086&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/Tools.cpp (original)
+++ cfe/trunk/lib/Driver/Tools.cpp Sun May 18 01:42:02 2014
@@ -3451,6 +3451,11 @@ void Clang::ConstructJob(Compilation &C,
       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

Added: cfe/trunk/test/Driver/woa-restrict-it.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/woa-restrict-it.c?rev=209086&view=auto
==============================================================================
--- cfe/trunk/test/Driver/woa-restrict-it.c (added)
+++ cfe/trunk/test/Driver/woa-restrict-it.c Sun May 18 01:42:02 2014
@@ -0,0 +1,4 @@
+// RUN: %clang -target armv7-windows -### %s 2>&1 | FileCheck %s
+
+// CHECK: "-backend-option" "-arm-restrict-it"
+





More information about the cfe-commits mailing list