[PATCH] Default to armv7 cpu for NaCl when march=arm

Derek Schuff dschuff at google.com
Tue Mar 24 14:33:22 PDT 2015


Hi jvoung,

When the arch is given as "arm" clang uses the default target CPU from
LLVM to determine what the real arch should be (i.e. "arm" becomes
"armv4t" because LLVM's getARMCPUForArch falls back to "arm7tdmi").
Default to "cortex-a9" so that we end up with "armv7" in clang.

the nacl-direct.c test in clang covers this case.

http://reviews.llvm.org/D8589

Files:
  lib/Support/Triple.cpp

Index: lib/Support/Triple.cpp
===================================================================
--- lib/Support/Triple.cpp
+++ lib/Support/Triple.cpp
@@ -1074,6 +1074,10 @@
   case llvm::Triple::Win32:
     // FIXME: this is invalid for WindowsCE
     return "cortex-a9";
+  case llvm::Triple::NaCl:
+    if (MArch == "arm")
+      return "cortex-a9";
+    break;
   default:
     break;
   }

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D8589.22601.patch
Type: text/x-patch
Size: 395 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150324/fbd6ade1/attachment.bin>


More information about the llvm-commits mailing list