diff options
author | George Burgess IV <george.burgess.iv@gmail.com> | 2018-01-17 03:12:06 +0000 |
---|---|---|
committer | George Burgess IV <george.burgess.iv@gmail.com> | 2018-01-17 03:12:06 +0000 |
commit | 41e646d8ea3201605b6c5f80172758b7bb4f66f1 (patch) | |
tree | de82e24508b43c776621c3b7643aa0a0e8912d19 /llvm/lib/Support/TargetParser.cpp | |
parent | a5ddd3cacb01ede6576d14d7ff9a3faee7d80f06 (diff) | |
download | bcm5719-llvm-41e646d8ea3201605b6c5f80172758b7bb4f66f1.tar.gz bcm5719-llvm-41e646d8ea3201605b6c5f80172758b7bb4f66f1.zip |
[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
Diffstat (limited to 'llvm/lib/Support/TargetParser.cpp')
-rw-r--r-- | llvm/lib/Support/TargetParser.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Support/TargetParser.cpp b/llvm/lib/Support/TargetParser.cpp index 68684154178..5f288ff8e4a 100644 --- a/llvm/lib/Support/TargetParser.cpp +++ b/llvm/lib/Support/TargetParser.cpp @@ -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; } |