diff options
author | Cyndy Ishida <cyndy_ishida@apple.com> | 2025-08-06 10:44:00 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-08-06 10:44:00 -0700 |
commit | 477a65a051ce151895193f8dede1262fdc251132 (patch) | |
tree | 5fde8c88da418f17223e60b3555b2101e90798d3 /llvm/lib/TextAPI | |
parent | 0a23b22d1d43b2816e67aa8c328365b9bf114c74 (diff) | |
download | llvm-477a65a051ce151895193f8dede1262fdc251132.zip llvm-477a65a051ce151895193f8dede1262fdc251132.tar.gz llvm-477a65a051ce151895193f8dede1262fdc251132.tar.bz2 |
[TextAPI] Seperate out Arch name from enum label, NFCI (#152332)
The enum label e.g. `AK_arm64` is often the same as the architecture
name, but doesn't have to be. Seperate it out.
Diffstat (limited to 'llvm/lib/TextAPI')
-rw-r--r-- | llvm/lib/TextAPI/Architecture.cpp | 12 | ||||
-rw-r--r-- | llvm/lib/TextAPI/TextStubCommon.cpp | 2 |
2 files changed, 7 insertions, 7 deletions
diff --git a/llvm/lib/TextAPI/Architecture.cpp b/llvm/lib/TextAPI/Architecture.cpp index 51ca91d..3b53067 100644 --- a/llvm/lib/TextAPI/Architecture.cpp +++ b/llvm/lib/TextAPI/Architecture.cpp @@ -21,7 +21,7 @@ namespace llvm { namespace MachO { Architecture getArchitectureFromCpuType(uint32_t CPUType, uint32_t CPUSubType) { -#define ARCHINFO(Arch, Type, Subtype, NumBits) \ +#define ARCHINFO(Arch, Name, Type, Subtype, NumBits) \ if (CPUType == (Type) && \ (CPUSubType & ~MachO::CPU_SUBTYPE_MASK) == (Subtype)) \ return AK_##Arch; @@ -33,7 +33,7 @@ Architecture getArchitectureFromCpuType(uint32_t CPUType, uint32_t CPUSubType) { Architecture getArchitectureFromName(StringRef Name) { return StringSwitch<Architecture>(Name) -#define ARCHINFO(Arch, Type, Subtype, NumBits) .Case(#Arch, AK_##Arch) +#define ARCHINFO(Arch, Name, Type, Subtype, NumBits) .Case(#Name, AK_##Arch) #include "llvm/TextAPI/Architecture.def" #undef ARCHINFO .Default(AK_unknown); @@ -41,9 +41,9 @@ Architecture getArchitectureFromName(StringRef Name) { StringRef getArchitectureName(Architecture Arch) { switch (Arch) { -#define ARCHINFO(Arch, Type, Subtype, NumBits) \ +#define ARCHINFO(Arch, Name, Type, Subtype, NumBits) \ case AK_##Arch: \ - return #Arch; + return #Name; #include "llvm/TextAPI/Architecture.def" #undef ARCHINFO case AK_unknown: @@ -57,7 +57,7 @@ StringRef getArchitectureName(Architecture Arch) { std::pair<uint32_t, uint32_t> getCPUTypeFromArchitecture(Architecture Arch) { switch (Arch) { -#define ARCHINFO(Arch, Type, Subtype, NumBits) \ +#define ARCHINFO(Arch, Name, Type, Subtype, NumBits) \ case AK_##Arch: \ return std::make_pair(Type, Subtype); #include "llvm/TextAPI/Architecture.def" @@ -77,7 +77,7 @@ Architecture mapToArchitecture(const Triple &Target) { bool is64Bit(Architecture Arch) { switch (Arch) { -#define ARCHINFO(Arch, Type, Subtype, NumBits) \ +#define ARCHINFO(Arch, Name, Type, Subtype, NumBits) \ case AK_##Arch: \ return NumBits == 64; #include "llvm/TextAPI/Architecture.def" diff --git a/llvm/lib/TextAPI/TextStubCommon.cpp b/llvm/lib/TextAPI/TextStubCommon.cpp index 0b710b0..7bf1f9a 100644 --- a/llvm/lib/TextAPI/TextStubCommon.cpp +++ b/llvm/lib/TextAPI/TextStubCommon.cpp @@ -133,7 +133,7 @@ QuotingType ScalarTraits<PlatformSet>::mustQuote(StringRef) { void ScalarBitSetTraits<ArchitectureSet>::bitset(IO &IO, ArchitectureSet &Archs) { -#define ARCHINFO(arch, type, subtype, numbits) \ +#define ARCHINFO(arch, name, type, subtype, numbits) \ IO.bitSetCase(Archs, #arch, 1U << static_cast<int>(AK_##arch)); #include "llvm/TextAPI/Architecture.def" #undef ARCHINFO |