mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-11-25 23:00:15 +00:00
Update for API change in LLVM: ARMTargetParser class is just the ARM
namespace. llvm-svn: 246368
This commit is contained in:
parent
bb47b9a367
commit
aa0caeb431
@ -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;
|
||||
|
@ -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.
|
||||
|
@ -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<const char *> &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<const char *> &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,
|
||||
|
Loading…
Reference in New Issue
Block a user