diff options
author | Zijiao Ma <jojo.ma@linaro.org> | 2016-08-17 02:08:28 +0000 |
---|---|---|
committer | Zijiao Ma <jojo.ma@linaro.org> | 2016-08-17 02:08:28 +0000 |
commit | 53d55f45a1fde4683e2ebc0fc83c39c2a36a99d7 (patch) | |
tree | 86ff91a1d99677cc8591a79b6e54b4489fe94576 /llvm/lib/Target/ARM/ARMSubtarget.cpp | |
parent | 47416615737795327efc3ce3c99566debe16ed04 (diff) | |
download | llvm-53d55f45a1fde4683e2ebc0fc83c39c2a36a99d7.zip llvm-53d55f45a1fde4683e2ebc0fc83c39c2a36a99d7.tar.gz llvm-53d55f45a1fde4683e2ebc0fc83c39c2a36a99d7.tar.bz2 |
Some places that could using TargetParser in LLVM. NFC.
llvm-svn: 278888
Diffstat (limited to 'llvm/lib/Target/ARM/ARMSubtarget.cpp')
-rw-r--r-- | llvm/lib/Target/ARM/ARMSubtarget.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/llvm/lib/Target/ARM/ARMSubtarget.cpp b/llvm/lib/Target/ARM/ARMSubtarget.cpp index 561f80a..b6e2b3a 100644 --- a/llvm/lib/Target/ARM/ARMSubtarget.cpp +++ b/llvm/lib/Target/ARM/ARMSubtarget.cpp @@ -31,6 +31,7 @@ #include "llvm/Target/TargetInstrInfo.h" #include "llvm/Target/TargetOptions.h" #include "llvm/Target/TargetRegisterInfo.h" +#include "llvm/Support/TargetParser.h" using namespace llvm; @@ -117,10 +118,11 @@ void ARMSubtarget::initSubtargetFeatures(StringRef CPU, StringRef FS) { if (isTargetDarwin()) { StringRef ArchName = TargetTriple.getArchName(); - if (ArchName.endswith("v7s")) + unsigned ArchKind = llvm::ARM::parseArch(ArchName); + if (ArchKind == llvm::ARM::AK_ARMV7S) // Default to the Swift CPU when targeting armv7s/thumbv7s. CPUString = "swift"; - else if (ArchName.endswith("v7k")) + else if (ArchKind == llvm::ARM::AK_ARMV7K) // Default to the Cortex-a7 CPU when targeting armv7k/thumbv7k. // ARMv7k does not use SjLj exception handling. CPUString = "cortex-a7"; |