Support clrex instruction on ARMv6k. Patch by Andrew Turner.
[oota-llvm.git] / lib / Target / ARM / MCTargetDesc / ARMMCAsmInfo.cpp
index 90746468fe93f8ac6434c3131a2b4e92ba4aa16b..bda37f6616a8dd3d89bcdb39922984b29fe72be0 100644 (file)
 //===----------------------------------------------------------------------===//
 
 #include "ARMMCAsmInfo.h"
-#include "llvm/ADT/TargetTuple.h"
+#include "llvm/ADT/Triple.h"
 #include "llvm/Support/CommandLine.h"
 
 using namespace llvm;
 
 void ARMMCAsmInfoDarwin::anchor() { }
 
-ARMMCAsmInfoDarwin::ARMMCAsmInfoDarwin(const TargetTuple &TT) {
-  if ((TT.getArch() == TargetTuple::armeb) ||
-      (TT.getArch() == TargetTuple::thumbeb))
+ARMMCAsmInfoDarwin::ARMMCAsmInfoDarwin(const Triple &TheTriple) {
+  if ((TheTriple.getArch() == Triple::armeb) ||
+      (TheTriple.getArch() == Triple::thumbeb))
     IsLittleEndian = false;
 
   Data64bitsDirective = nullptr;
@@ -33,16 +33,18 @@ ARMMCAsmInfoDarwin::ARMMCAsmInfoDarwin(const TargetTuple &TT) {
   SupportsDebugInformation = true;
 
   // Exceptions handling
-  ExceptionsType = ExceptionHandling::SjLj;
+  ExceptionsType = TheTriple.isOSDarwin() && !TheTriple.isWatchOS()
+                       ? ExceptionHandling::SjLj
+                       : ExceptionHandling::DwarfCFI;
 
   UseIntegratedAssembler = true;
 }
 
 void ARMELFMCAsmInfo::anchor() { }
 
-ARMELFMCAsmInfo::ARMELFMCAsmInfo(const TargetTuple &TT) {
-  if ((TT.getArch() == TargetTuple::armeb) ||
-      (TT.getArch() == TargetTuple::thumbeb))
+ARMELFMCAsmInfo::ARMELFMCAsmInfo(const Triple &TheTriple) {
+  if ((TheTriple.getArch() == Triple::armeb) ||
+      (TheTriple.getArch() == Triple::thumbeb))
     IsLittleEndian = false;
 
   // ".comm align is in bytes but .align is pow-2."
@@ -56,9 +58,9 @@ ARMELFMCAsmInfo::ARMELFMCAsmInfo(const TargetTuple &TT) {
   SupportsDebugInformation = true;
 
   // Exceptions handling
-  switch (TT.getOS()) {
-  case TargetTuple::Bitrig:
-  case TargetTuple::NetBSD:
+  switch (TheTriple.getOS()) {
+  case Triple::Bitrig:
+  case Triple::NetBSD:
     ExceptionsType = ExceptionHandling::DwarfCFI;
     break;
   default: