From b2f21554da16eca47e9126ac646f7b16326cc510 Mon Sep 17 00:00:00 2001 From: Chandler Carruth Date: Sun, 30 Aug 2015 02:16:36 +0000 Subject: [PATCH] Update for API change in LLVM: ARMTargetParser class is just the ARM namespace. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@246368 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Basic/Targets.cpp | 18 +++++++++--------- lib/Driver/ToolChains.cpp | 4 ++-- lib/Driver/Tools.cpp | 22 +++++++++++----------- 3 files changed, 22 insertions(+), 22 deletions(-) diff --git a/lib/Basic/Targets.cpp b/lib/Basic/Targets.cpp index ee9a37153f..74dde889f8 100644 --- a/lib/Basic/Targets.cpp +++ b/lib/Basic/Targets.cpp @@ -4184,13 +4184,13 @@ class ARMTargetInfo : public TargetInfo { void setArchInfo() { StringRef ArchName = getTriple().getArchName(); - ArchISA = llvm::ARMTargetParser::parseArchISA(ArchName); + ArchISA = llvm::ARM::parseArchISA(ArchName); DefaultCPU = getDefaultCPU(ArchName); - unsigned ArchKind = llvm::ARMTargetParser::parseArch(ArchName); + unsigned ArchKind = llvm::ARM::parseArch(ArchName); if (ArchKind == llvm::ARM::AK_INVALID) // set arch of the CPU, either provided explicitly or hardcoded default - ArchKind = llvm::ARMTargetParser::parseCPUArch(CPU); + ArchKind = llvm::ARM::parseCPUArch(CPU); setArchInfo(ArchKind); } @@ -4199,9 +4199,9 @@ class ARMTargetInfo : public TargetInfo { // cache TargetParser info ArchKind = Kind; - SubArch = llvm::ARMTargetParser::getSubArch(ArchKind); - ArchProfile = llvm::ARMTargetParser::parseArchProfile(SubArch); - ArchVersion = llvm::ARMTargetParser::parseArchVersion(SubArch); + SubArch = llvm::ARM::getSubArch(ArchKind); + ArchProfile = llvm::ARM::parseArchProfile(SubArch); + ArchVersion = llvm::ARM::parseArchVersion(SubArch); // cache CPU related strings CPUAttr = getCPUAttr(); @@ -4241,7 +4241,7 @@ class ARMTargetInfo : public TargetInfo { } StringRef getDefaultCPU(StringRef ArchName) const { - const char *DefaultCPU = llvm::ARMTargetParser::getDefaultCPU(ArchName); + const char *DefaultCPU = llvm::ARM::getDefaultCPU(ArchName); return DefaultCPU ? DefaultCPU : ""; } @@ -4251,7 +4251,7 @@ class ARMTargetInfo : public TargetInfo { // For Cortex variants, it's slightly different. switch(ArchKind) { default: - CPUAttr = llvm::ARMTargetParser::getCPUAttr(ArchKind); + CPUAttr = llvm::ARM::getCPUAttr(ArchKind); return CPUAttr ? CPUAttr : ""; case llvm::ARM::AK_ARMV6M: case llvm::ARM::AK_ARMV6SM: @@ -4501,7 +4501,7 @@ public: bool setCPU(const std::string &Name) override { if (Name != "generic") - setArchInfo(llvm::ARMTargetParser::parseCPUArch(Name)); + setArchInfo(llvm::ARM::parseCPUArch(Name)); if (ArchKind == llvm::ARM::AK_INVALID) return false; diff --git a/lib/Driver/ToolChains.cpp b/lib/Driver/ToolChains.cpp index 34a8da6849..54201aab70 100644 --- a/lib/Driver/ToolChains.cpp +++ b/lib/Driver/ToolChains.cpp @@ -104,10 +104,10 @@ static const char *ArmMachOArchName(StringRef Arch) { } static const char *ArmMachOArchNameCPU(StringRef CPU) { - unsigned ArchKind = llvm::ARMTargetParser::parseCPUArch(CPU); + unsigned ArchKind = llvm::ARM::parseCPUArch(CPU); if (ArchKind == llvm::ARM::AK_INVALID) return nullptr; - StringRef Arch = llvm::ARMTargetParser::getArchName(ArchKind); + StringRef Arch = llvm::ARM::getArchName(ArchKind); // FIXME: Make sure this MachO triple mangling is really necessary. // ARMv5* normalises to ARMv5. diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp index c838d6bd32..e9df9500fb 100644 --- a/lib/Driver/Tools.cpp +++ b/lib/Driver/Tools.cpp @@ -493,13 +493,13 @@ static bool isNoCommonDefault(const llvm::Triple &Triple) { // Get SubArch (vN). static int getARMSubArchVersionNumber(const llvm::Triple &Triple) { llvm::StringRef Arch = Triple.getArchName(); - return llvm::ARMTargetParser::parseArchVersion(Arch); + return llvm::ARM::parseArchVersion(Arch); } // True if M-profile. static bool isARMMProfile(const llvm::Triple &Triple) { llvm::StringRef Arch = Triple.getArchName(); - unsigned Profile = llvm::ARMTargetParser::parseArchProfile(Arch); + unsigned Profile = llvm::ARM::parseArchProfile(Arch); return Profile == llvm::ARM::PK_M; } @@ -528,8 +528,8 @@ static void getARMArchCPUFromArgs(const ArgList &Args, llvm::StringRef &Arch, static void getARMHWDivFeatures(const Driver &D, const Arg *A, const ArgList &Args, StringRef HWDiv, std::vector &Features) { - unsigned HWDivID = llvm::ARMTargetParser::parseHWDiv(HWDiv); - if (!llvm::ARMTargetParser::getHWDivFeatures(HWDivID, Features)) + unsigned HWDivID = llvm::ARM::parseHWDiv(HWDiv); + if (!llvm::ARM::getHWDivFeatures(HWDivID, Features)) D.Diag(diag::err_drv_clang_unsupported) << A->getAsString(Args); } @@ -537,8 +537,8 @@ static void getARMHWDivFeatures(const Driver &D, const Arg *A, static void getARMFPUFeatures(const Driver &D, const Arg *A, const ArgList &Args, StringRef FPU, std::vector &Features) { - unsigned FPUID = llvm::ARMTargetParser::parseFPU(FPU); - if (!llvm::ARMTargetParser::getFPUFeatures(FPUID, Features)) + unsigned FPUID = llvm::ARM::parseFPU(FPU); + if (!llvm::ARM::getFPUFeatures(FPUID, Features)) D.Diag(diag::err_drv_clang_unsupported) << A->getAsString(Args); } @@ -549,7 +549,7 @@ static void checkARMArchName(const Driver &D, const Arg *A, const ArgList &Args, llvm::StringRef ArchName, const llvm::Triple &Triple) { std::string MArch = arm::getARMArch(ArchName, Triple); - if (llvm::ARMTargetParser::parseArch(MArch) == llvm::ARM::AK_INVALID) + if (llvm::ARM::parseArch(MArch) == llvm::ARM::AK_INVALID) D.Diag(diag::err_drv_clang_unsupported) << A->getAsString(Args); } @@ -6069,13 +6069,13 @@ std::string arm::getARMTargetCPU(StringRef CPU, StringRef Arch, // FIXME: This is redundant with -mcpu, why does LLVM use this. const char *arm::getLLVMArchSuffixForARM(StringRef CPU, StringRef Arch) { if (CPU == "generic") - return llvm::ARMTargetParser::getSubArch( - llvm::ARMTargetParser::parseArch(Arch)); + return llvm::ARM::getSubArch( + llvm::ARM::parseArch(Arch)); - unsigned ArchKind = llvm::ARMTargetParser::parseCPUArch(CPU); + unsigned ArchKind = llvm::ARM::parseCPUArch(CPU); if (ArchKind == llvm::ARM::AK_INVALID) return ""; - return llvm::ARMTargetParser::getSubArch(ArchKind); + return llvm::ARM::getSubArch(ArchKind); } void arm::appendEBLinkFlags(const ArgList &Args, ArgStringList &CmdArgs, -- 2.40.0