r278890 - Some missing usage of TargetParser. NFC.
Zijiao Ma via cfe-commits
cfe-commits at lists.llvm.org
Tue Aug 16 19:13:33 PDT 2016
Author: zijiaoma
Date: Tue Aug 16 21:13:33 2016
New Revision: 278890
URL: http://llvm.org/viewvc/llvm-project?rev=278890&view=rev
Log:
Some missing usage of TargetParser. NFC.
Modified:
cfe/trunk/lib/Basic/Targets.cpp
cfe/trunk/lib/Driver/Tools.cpp
Modified: cfe/trunk/lib/Basic/Targets.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/Targets.cpp?rev=278890&r1=278889&r2=278890&view=diff
==============================================================================
--- cfe/trunk/lib/Basic/Targets.cpp (original)
+++ cfe/trunk/lib/Basic/Targets.cpp Tue Aug 16 21:13:33 2016
@@ -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()) {
Modified: cfe/trunk/lib/Driver/Tools.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=278890&r1=278889&r2=278890&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/Tools.cpp (original)
+++ cfe/trunk/lib/Driver/Tools.cpp Tue Aug 16 21:13:33 2016
@@ -7465,11 +7465,14 @@ llvm::Triple::ArchType darwin::getArchTy
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);
}
More information about the cfe-commits
mailing list