r238037 - Use profile and version parsers from ARMTargetParser
Renato Golin
renato.golin at linaro.org
Fri May 22 11:18:25 PDT 2015
Author: rengolin
Date: Fri May 22 13:18:25 2015
New Revision: 238037
URL: http://llvm.org/viewvc/llvm-project?rev=238037&view=rev
Log:
Use profile and version parsers from ARMTargetParser
Now that ARMTargetParser can parse profile and version numbers,
use them instead of the local implementation.
Modified:
cfe/trunk/lib/Driver/Tools.cpp
Modified: cfe/trunk/lib/Driver/Tools.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=238037&r1=238036&r2=238037&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/Tools.cpp (original)
+++ cfe/trunk/lib/Driver/Tools.cpp Fri May 22 13:18:25 2015
@@ -617,42 +617,15 @@ static void getARMFPUFeatures(const Driv
}
}
-// 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
More information about the cfe-commits
mailing list