Some missing usage of TargetParser. NFC.

llvm-svn: 278890
This commit is contained in:
Zijiao Ma 2016-08-17 02:13:33 +00:00
parent e2cc07bc0b
commit 56a837238d
2 changed files with 6 additions and 3 deletions

View File

@ -4901,7 +4901,7 @@ public:
// the frontend matches that.
if (Triple.getEnvironment() == llvm::Triple::EABI ||
Triple.getOS() == llvm::Triple::UnknownOS ||
StringRef(CPU).startswith("cortex-m")) {
ArchProfile == llvm::ARM::PK_M) {
setABI("aapcs");
} else if (Triple.isWatchABI()) {
setABI("aapcs16");
@ -5230,7 +5230,7 @@ public:
if (SoftFloat)
Builder.defineMacro("__SOFTFP__");
if (CPU == "xscale")
if (ArchKind == llvm::ARM::AK_XSCALE)
Builder.defineMacro("__XSCALE__");
if (isThumb()) {

View File

@ -7465,11 +7465,14 @@ llvm::Triple::ArchType darwin::getArchTypeForMachOArchName(StringRef Str) {
void darwin::setTripleTypeForMachOArchName(llvm::Triple &T, StringRef Str) {
const llvm::Triple::ArchType Arch = getArchTypeForMachOArchName(Str);
unsigned ArchKind = llvm::ARM::parseArch(Str);
T.setArch(Arch);
if (Str == "x86_64h")
T.setArchName(Str);
else if (Str == "armv6m" || Str == "armv7m" || Str == "armv7em") {
else if (ArchKind == llvm::ARM::AK_ARMV6M ||
ArchKind == llvm::ARM::AK_ARMV7M ||
ArchKind == llvm::ARM::AK_ARMV7EM) {
T.setOS(llvm::Triple::UnknownOS);
T.setObjectFormat(llvm::Triple::MachO);
}