diff --git a/llvm/include/llvm/Support/AArch64TargetParser.h b/llvm/include/llvm/Support/AArch64TargetParser.h --- a/llvm/include/llvm/Support/AArch64TargetParser.h +++ b/llvm/include/llvm/Support/AArch64TargetParser.h @@ -83,13 +83,13 @@ #include "AArch64TargetParser.def" }; -template struct ArchNames { +struct ArchNames { const char *NameCStr; size_t NameLength; const char *SubArchCStr; size_t SubArchLength; uint64_t ArchBaseExtensions; - T ID; + ArchKind ID; StringRef getName() const { return StringRef(NameCStr, NameLength); } @@ -104,7 +104,7 @@ } }; -const ArchNames AArch64ARCHNames[] = { +const ArchNames AArch64ARCHNames[] = { #define AARCH64_ARCH(NAME, ID, SUB_ARCH, ARCH_BASE_EXT) \ {NAME, sizeof(NAME) - 1, "+" SUB_ARCH, sizeof(SUB_ARCH), \ ARCH_BASE_EXT, AArch64::ArchKind::ID}, @@ -132,17 +132,17 @@ // The same CPU can have multiple arches and can be default on multiple arches. // When finding the Arch for a CPU, first-found prevails. Sort them accordingly. // When this becomes table-generated, we'd probably need two tables. -template struct CpuNames { +struct CpuNames { const char *NameCStr; size_t NameLength; - T ArchID; + ArchKind ArchID; bool Default; // is $Name the default CPU for $ArchID ? uint64_t DefaultExtensions; StringRef getName() const { return StringRef(NameCStr, NameLength); } }; -const CpuNames AArch64CPUNames[] = { +const CpuNames AArch64CPUNames[] = { #define AARCH64_CPU_NAME(NAME, ID, DEFAULT_FPU, IS_DEFAULT, DEFAULT_EXT) \ {NAME, sizeof(NAME) - 1, AArch64::ArchKind::ID, IS_DEFAULT, DEFAULT_EXT}, #include "AArch64TargetParser.def" @@ -178,7 +178,6 @@ return Kind; } -// FIXME: These should be moved to TargetTuple once it exists bool getExtensionFeatures(uint64_t Extensions, std::vector &Features); bool getArchFeatures(ArchKind AK, std::vector &Features); diff --git a/llvm/include/llvm/Support/ARMTargetParser.h b/llvm/include/llvm/Support/ARMTargetParser.h --- a/llvm/include/llvm/Support/ARMTargetParser.h +++ b/llvm/include/llvm/Support/ARMTargetParser.h @@ -111,17 +111,17 @@ // When finding the Arch for a CPU, first-found prevails. Sort them accordingly. // When this becomes table-generated, we'd probably need two tables. // FIXME: TableGen this. -template struct CpuNames { +struct CpuNames { const char *NameCStr; size_t NameLength; - T ArchID; + ArchKind ArchID; bool Default; // is $Name the default CPU for $ArchID ? uint64_t DefaultExtensions; StringRef getName() const { return StringRef(NameCStr, NameLength); } }; -const CpuNames CPUNames[] = { +const CpuNames CPUNames[] = { #define ARM_CPU_NAME(NAME, ID, DEFAULT_FPU, IS_DEFAULT, DEFAULT_EXT) \ {NAME, sizeof(NAME) - 1, ARM::ArchKind::ID, IS_DEFAULT, DEFAULT_EXT}, #include "ARMTargetParser.def" @@ -192,7 +192,7 @@ // of the triples and are not conforming with their official names. // Check to see if the expectation should be changed. // FIXME: TableGen this. -template struct ArchNames { +struct ArchNames { const char *NameCStr; size_t NameLength; const char *CPUAttrCStr; @@ -201,7 +201,7 @@ size_t SubArchLength; unsigned DefaultFPU; uint64_t ArchBaseExtensions; - T ID; + ArchKind ID; ARMBuildAttrs::CPUArch ArchAttr; // Arch ID in build attributes. StringRef getName() const { return StringRef(NameCStr, NameLength); } @@ -220,7 +220,7 @@ } }; -static const ArchNames ARMArchNames[] = { +static const ArchNames ARMArchNames[] = { #define ARM_ARCH(NAME, ID, CPU_ATTR, SUB_ARCH, ARCH_ATTR, ARCH_FPU, \ ARCH_BASE_EXT) \ {NAME, sizeof(NAME) - 1, \ @@ -251,7 +251,6 @@ NeonSupportLevel getFPUNeonSupportLevel(unsigned FPUKind); FPURestriction getFPURestriction(unsigned FPUKind); -// FIXME: These should be moved to TargetTuple once it exists bool getFPUFeatures(unsigned FPUKind, std::vector &Features); bool getHWDivFeatures(uint64_t HWDivKind, std::vector &Features); bool getExtensionFeatures(uint64_t Extensions, diff --git a/llvm/lib/Support/ARMTargetParser.cpp b/llvm/lib/Support/ARMTargetParser.cpp --- a/llvm/lib/Support/ARMTargetParser.cpp +++ b/llvm/lib/Support/ARMTargetParser.cpp @@ -487,7 +487,7 @@ } void ARM::fillValidCPUArchList(SmallVectorImpl &Values) { - for (const CpuNames &Arch : CPUNames) { + for (const auto &Arch : CPUNames) { if (Arch.ArchID != ArchKind::INVALID) Values.push_back(Arch.getName()); }