diff --git a/include/llvm/ADT/Triple.h b/include/llvm/ADT/Triple.h index 9b34d8a3da5..314ee4e3589 100644 --- a/include/llvm/ADT/Triple.h +++ b/include/llvm/ADT/Triple.h @@ -121,6 +121,7 @@ public: GNUEABIHF, GNUX32, EABI, + EABIHF, MachO, Android, ELF diff --git a/lib/Support/Triple.cpp b/lib/Support/Triple.cpp index 20531b15efd..273316a0a6f 100644 --- a/lib/Support/Triple.cpp +++ b/lib/Support/Triple.cpp @@ -150,6 +150,7 @@ const char *Triple::getEnvironmentTypeName(EnvironmentType Kind) { case GNUEABI: return "gnueabi"; case GNUX32: return "gnux32"; case EABI: return "eabi"; + case EABIHF: return "eabihf"; case MachO: return "macho"; case Android: return "android"; case ELF: return "elf"; @@ -297,6 +298,7 @@ static Triple::OSType parseOS(StringRef OSName) { static Triple::EnvironmentType parseEnvironment(StringRef EnvironmentName) { return StringSwitch(EnvironmentName) + .StartsWith("eabihf", Triple::EABIHF) .StartsWith("eabi", Triple::EABI) .StartsWith("gnueabihf", Triple::GNUEABIHF) .StartsWith("gnueabi", Triple::GNUEABI) diff --git a/lib/Target/ARM/ARMSubtarget.cpp b/lib/Target/ARM/ARMSubtarget.cpp index a0bf7a63e83..3c5bed52b7b 100644 --- a/lib/Target/ARM/ARMSubtarget.cpp +++ b/lib/Target/ARM/ARMSubtarget.cpp @@ -192,6 +192,7 @@ void ARMSubtarget::resetSubtargetFeatures(StringRef CPU, StringRef FS) { switch (TargetTriple.getEnvironment()) { case Triple::Android: case Triple::EABI: + case Triple::EABIHF: case Triple::GNUEABI: case Triple::GNUEABIHF: TargetABI = ARM_ABI_AAPCS; diff --git a/lib/Target/ARM/ARMSubtarget.h b/lib/Target/ARM/ARMSubtarget.h index 45a7a1aaaec..42bc155d3be 100644 --- a/lib/Target/ARM/ARMSubtarget.h +++ b/lib/Target/ARM/ARMSubtarget.h @@ -317,7 +317,8 @@ public: // even for GNUEABI, so we can make a distinction here and still conform to // the EABI on GNU (and Android) mode. This requires change in Clang, too. bool isTargetAEABI() const { - return TargetTriple.getEnvironment() == Triple::EABI; + return TargetTriple.getEnvironment() == Triple::EABI || + TargetTriple.getEnvironment() == Triple::EABIHF; } bool isAPCS_ABI() const { return TargetABI == ARM_ABI_APCS; } diff --git a/test/CodeGen/ARM/divmod-eabi.ll b/test/CodeGen/ARM/divmod-eabi.ll index 404cae0da2b..64d093e768b 100644 --- a/test/CodeGen/ARM/divmod-eabi.ll +++ b/test/CodeGen/ARM/divmod-eabi.ll @@ -1,4 +1,5 @@ ; RUN: llc -mtriple armv7-none-eabi %s -o - | FileCheck %s --check-prefix=EABI +; RUN: llc -mtriple armv7-none-eabihf %s -o - | FileCheck %s --check-prefix=EABI ; RUN: llc -mtriple armv7-linux-gnueabi %s -o - | FileCheck %s --check-prefix=GNU ; RUN: llc -mtriple armv7-apple-darwin %s -o - | FileCheck %s --check-prefix=DARWIN diff --git a/test/CodeGen/ARM/memfunc.ll b/test/CodeGen/ARM/memfunc.ll index fe0056c42a1..a724080b74c 100644 --- a/test/CodeGen/ARM/memfunc.ll +++ b/test/CodeGen/ARM/memfunc.ll @@ -1,6 +1,7 @@ ; RUN: llc < %s -mtriple=armv7-apple-ios -o - | FileCheck %s ; RUN: llc < %s -mtriple=thumbv7m-darwin-eabi -o - | FileCheck %s --check-prefix=DARWIN ; RUN: llc < %s -mtriple=arm-none-eabi -o - | FileCheck --check-prefix=EABI %s +; RUN: llc < %s -mtriple=arm-none-eabihf -o - | FileCheck --check-prefix=EABI %s @from = common global [500 x i32] zeroinitializer, align 4 @to = common global [500 x i32] zeroinitializer, align 4