r239101 - Simplify ARMTargetParser::parseArch(ARMTargetParser::getCanonical()), following r239099
Artyom Skrobov
Artyom.Skrobov at arm.com
Thu Jun 4 14:31:42 PDT 2015
Author: askrobov
Date: Thu Jun 4 16:31:41 2015
New Revision: 239101
URL: http://llvm.org/viewvc/llvm-project?rev=239101&view=rev
Log:
Simplify ARMTargetParser::parseArch(ARMTargetParser::getCanonical()), following r239099
Reviewers: rengolin
Reviewed By: rengolin
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D10256
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=239101&r1=239100&r2=239101&view=diff
==============================================================================
--- cfe/trunk/lib/Basic/Targets.cpp (original)
+++ cfe/trunk/lib/Basic/Targets.cpp Thu Jun 4 16:31:41 2015
@@ -4188,9 +4188,7 @@ public:
// FIXME: This should be based on Arch attributes, not CPU names.
void getDefaultFeatures(llvm::StringMap<bool> &Features) const override {
StringRef ArchName = getTriple().getArchName();
- unsigned ArchKind =
- llvm::ARMTargetParser::parseArch(
- llvm::ARMTargetParser::getCanonicalArchName(ArchName));
+ unsigned ArchKind = llvm::ARMTargetParser::parseArch(ArchName);
bool IsV8 = (ArchKind == llvm::ARM::AK_ARMV8A ||
ArchKind == llvm::ARM::AK_ARMV8_1A);
Modified: cfe/trunk/lib/Driver/Tools.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=239101&r1=239100&r2=239101&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/Tools.cpp (original)
+++ cfe/trunk/lib/Driver/Tools.cpp Thu Jun 4 16:31:41 2015
@@ -758,7 +758,6 @@ static void getARMTargetFeatures(const D
// to handle -march=native correctly.
if (const Arg *A = Args.getLastArg(options::OPT_march_EQ)) {
StringRef Arch = arm::getARMArch(Args, Triple);
- Arch = llvm::ARMTargetParser::getCanonicalArchName(Arch);
if (llvm::ARMTargetParser::parseArch(Arch) == llvm::ARM::AK_INVALID)
D.Diag(diag::err_drv_clang_unsupported) << A->getAsString(Args);
}
@@ -5768,12 +5767,9 @@ std::string arm::getARMTargetCPU(const A
/// CPU (or Arch, if CPU is generic).
// FIXME: This is redundant with -mcpu, why does LLVM use this.
const char *arm::getLLVMArchSuffixForARM(StringRef CPU, StringRef Arch) {
- if (CPU == "generic") {
- unsigned ArchKind = llvm::ARMTargetParser::parseArch(
- llvm::ARMTargetParser::getCanonicalArchName(Arch));
- if (ArchKind == llvm::ARM::AK_ARMV8_1A)
- return "v8.1a";
- }
+ if (CPU == "generic" &&
+ llvm::ARMTargetParser::parseArch(Arch) == llvm::ARM::AK_ARMV8_1A)
+ return "v8.1a";
unsigned ArchKind = llvm::ARMTargetParser::parseCPUArch(CPU);
if (ArchKind == llvm::ARM::AK_INVALID)
More information about the cfe-commits
mailing list