[llvm] r238353 - ARMTargetParser: Make BSD Thumb/BE armv6 work
Renato Golin
renato.golin at linaro.org
Wed May 27 12:49:54 PDT 2015
Author: rengolin
Date: Wed May 27 14:49:53 2015
New Revision: 238353
URL: http://llvm.org/viewvc/llvm-project?rev=238353&view=rev
Log:
ARMTargetParser: Make BSD Thumb/BE armv6 work
Simple change to make arch like "thumbv6" and "armbev6" to return the
correct CPU for FreeBSD and NetBSD.
Modified:
llvm/trunk/lib/Support/Triple.cpp
llvm/trunk/unittests/ADT/TripleTest.cpp
Modified: llvm/trunk/lib/Support/Triple.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/Triple.cpp?rev=238353&r1=238352&r2=238353&view=diff
==============================================================================
--- llvm/trunk/lib/Support/Triple.cpp (original)
+++ llvm/trunk/lib/Support/Triple.cpp Wed May 27 14:49:53 2015
@@ -1113,8 +1113,8 @@ const char *Triple::getARMCPUForArch(Str
switch (getOS()) {
case llvm::Triple::FreeBSD:
case llvm::Triple::NetBSD:
- // FIXME: This doesn't work on BE/thumb variants.
- if (MArch == "armv6")
+ MArch = ARMTargetParser::getCanonicalArchName(MArch);
+ if (!MArch.empty() && MArch == "v6")
return "arm1176jzf-s";
break;
case llvm::Triple::Win32:
Modified: llvm/trunk/unittests/ADT/TripleTest.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/ADT/TripleTest.cpp?rev=238353&r1=238352&r2=238353&view=diff
==============================================================================
--- llvm/trunk/unittests/ADT/TripleTest.cpp (original)
+++ llvm/trunk/unittests/ADT/TripleTest.cpp Wed May 27 14:49:53 2015
@@ -800,6 +800,14 @@ TEST(TripleTest, getARMCPUForArch) {
EXPECT_STREQ("arm1176jzf-s", Triple.getARMCPUForArch());
}
{
+ llvm::Triple Triple("thumbv6-unknown-freebsd");
+ EXPECT_STREQ("arm1176jzf-s", Triple.getARMCPUForArch());
+ }
+ {
+ llvm::Triple Triple("armebv6-unknown-freebsd");
+ EXPECT_STREQ("arm1176jzf-s", Triple.getARMCPUForArch());
+ }
+ {
llvm::Triple Triple("arm--win32");
EXPECT_STREQ("cortex-a9", Triple.getARMCPUForArch());
}
More information about the llvm-commits
mailing list