Complete the existing support of ARM v6m, v7m, and v7em, i.e., respectively cortex-m0, cortex-m3, and cortex-m4 on the backend side.

Adds new subtype values for the MachO format and use them when the related triple are set.

llvm-svn: 172472
diff --git a/llvm/include/llvm/Object/MachOFormat.h b/llvm/include/llvm/Object/MachOFormat.h
index a17d58d..001cb65 100644
--- a/llvm/include/llvm/Object/MachOFormat.h
+++ b/llvm/include/llvm/Object/MachOFormat.h
@@ -64,7 +64,10 @@
     CSARM_V7     = 9,
     CSARM_V7F    = 10,
     CSARM_V7S    = 11,
-    CSARM_V7K    = 12
+    CSARM_V7K    = 12,
+    CSARM_V6M    = 14,
+    CSARM_V7M    = 15,
+    CSARM_V7EM   = 16
   };
 
   /// \brief PowerPC Machine Subtypes.
diff --git a/llvm/lib/Target/ARM/MCTargetDesc/ARMAsmBackend.cpp b/llvm/lib/Target/ARM/MCTargetDesc/ARMAsmBackend.cpp
index 1f1b334..415dee31 100644
--- a/llvm/lib/Target/ARM/MCTargetDesc/ARMAsmBackend.cpp
+++ b/llvm/lib/Target/ARM/MCTargetDesc/ARMAsmBackend.cpp
@@ -672,12 +672,21 @@
     else if (TheTriple.getArchName() == "armv6" ||
         TheTriple.getArchName() == "thumbv6")
       return new DarwinARMAsmBackend(T, TT, object::mach::CSARM_V6);
+    else if (TheTriple.getArchName() == "armv6m" ||
+        TheTriple.getArchName() == "thumbv6m")
+      return new DarwinARMAsmBackend(T, TT, object::mach::CSARM_V6M);
+    else if (TheTriple.getArchName() == "armv7em" ||
+        TheTriple.getArchName() == "thumbv7em")
+      return new DarwinARMAsmBackend(T, TT, object::mach::CSARM_V7EM);
     else if (TheTriple.getArchName() == "armv7f" ||
         TheTriple.getArchName() == "thumbv7f")
       return new DarwinARMAsmBackend(T, TT, object::mach::CSARM_V7F);
     else if (TheTriple.getArchName() == "armv7k" ||
         TheTriple.getArchName() == "thumbv7k")
       return new DarwinARMAsmBackend(T, TT, object::mach::CSARM_V7K);
+    else if (TheTriple.getArchName() == "armv7m" ||
+        TheTriple.getArchName() == "thumbv7m")
+      return new DarwinARMAsmBackend(T, TT, object::mach::CSARM_V7M);
     else if (TheTriple.getArchName() == "armv7s" ||
         TheTriple.getArchName() == "thumbv7s")
       return new DarwinARMAsmBackend(T, TT, object::mach::CSARM_V7S);