1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 02:52:53 +02:00

[Support] Return an enum instead of an unsigned; NFC.

We seem to be (logically) returning ArchExtKinds here in all cases, so
the return type should reflect that.

The static_cast is necessary because `A.ID` is actually an `unsigned`,
presumably since we use `decltype(A)` to represent extended attributes
for both ARM and AArch64, which use distinct `ArchExtKinds`.

We can't trivially make the same change for ARM, because one of the
values it returns is the bitwise-or of two `ARM::ArchExtKind`s.

llvm-svn: 322613
This commit is contained in:
George Burgess IV 2018-01-17 03:12:06 +00:00
parent a0861c6a1a
commit b312be79c8
2 changed files with 3 additions and 3 deletions

View File

@ -203,7 +203,7 @@ StringRef getDefaultCPU(StringRef Arch);
// Parser
unsigned parseFPU(StringRef FPU);
AArch64::ArchKind parseArch(StringRef Arch);
unsigned parseArchExt(StringRef ArchExt);
ArchExtKind parseArchExt(StringRef ArchExt);
ArchKind parseCPUArch(StringRef CPU);
ARM::ISAKind parseArchISA(StringRef Arch);
ARM::EndianKind parseArchEndian(StringRef Arch);

View File

@ -868,10 +868,10 @@ AArch64::ArchKind AArch64::parseArch(StringRef Arch) {
return ArchKind::INVALID;
}
unsigned llvm::AArch64::parseArchExt(StringRef ArchExt) {
AArch64::ArchExtKind llvm::AArch64::parseArchExt(StringRef ArchExt) {
for (const auto A : AArch64ARCHExtNames) {
if (ArchExt == A.getName())
return A.ID;
return static_cast<ArchExtKind>(A.ID);
}
return AArch64::AEK_INVALID;
}