From c7f06de7cf01e7552da38e08a0a410c71fbc6837 Mon Sep 17 00:00:00 2001 From: Renato Golin Date: Fri, 22 May 2015 18:18:25 +0000 Subject: [PATCH] Use profile and version parsers from ARMTargetParser Now that ARMTargetParser can parse profile and version numbers, use them instead of the local implementation. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@238037 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Driver/Tools.cpp | 37 +++++-------------------------------- 1 file changed, 5 insertions(+), 32 deletions(-) diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp index beb6a34c90..261af720d3 100644 --- a/lib/Driver/Tools.cpp +++ b/lib/Driver/Tools.cpp @@ -617,42 +617,15 @@ static void getARMFPUFeatures(const Driver &D, const Arg *A, } } -// FIXME: Move to ARMTargetParser. static int getARMSubArchVersionNumber(const llvm::Triple &Triple) { - switch (Triple.getSubArch()) { - case llvm::Triple::ARMSubArch_v8_1a: - case llvm::Triple::ARMSubArch_v8: - return 8; - case llvm::Triple::ARMSubArch_v7: - case llvm::Triple::ARMSubArch_v7em: - case llvm::Triple::ARMSubArch_v7m: - case llvm::Triple::ARMSubArch_v7s: - return 7; - case llvm::Triple::ARMSubArch_v6: - case llvm::Triple::ARMSubArch_v6m: - case llvm::Triple::ARMSubArch_v6k: - case llvm::Triple::ARMSubArch_v6t2: - return 6; - case llvm::Triple::ARMSubArch_v5: - case llvm::Triple::ARMSubArch_v5te: - return 5; - case llvm::Triple::ARMSubArch_v4t: - return 4; - default: - return 0; - } + llvm::StringRef Arch = Triple.getArchName(); + return llvm::ARMTargetParser::parseArchVersion(Arch); } -// FIXME: Move to ARMTargetParser. static bool isARMMProfile(const llvm::Triple &Triple) { - switch (Triple.getSubArch()) { - case llvm::Triple::ARMSubArch_v7em: - case llvm::Triple::ARMSubArch_v7m: - case llvm::Triple::ARMSubArch_v6m: - return true; - default: - return false; - } + llvm::StringRef Arch = Triple.getArchName(); + unsigned Profile = llvm::ARMTargetParser::parseArchProfile(Arch); + return Profile == llvm::ARM::PK_M; } // Select the float ABI as determined by -msoft-float, -mhard-float, and -- 2.40.0