From 41e646d8ea3201605b6c5f80172758b7bb4f66f1 Mon Sep 17 00:00:00 2001 From: George Burgess IV Date: Wed, 17 Jan 2018 03:12:06 +0000 Subject: [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 --- llvm/lib/Support/TargetParser.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'llvm/lib/Support/TargetParser.cpp') 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(A.ID); } return AArch64::AEK_INVALID; } -- cgit v1.2.3