[llvm] r251222 - [X86] Add support for elfiamcu triple
Michael Kuperstein via llvm-commits
llvm-commits at lists.llvm.org
Sun Oct 25 01:07:37 PDT 2015
Author: mkuper
Date: Sun Oct 25 03:07:37 2015
New Revision: 251222
URL: http://llvm.org/viewvc/llvm-project?rev=251222&view=rev
Log:
[X86] Add support for elfiamcu triple
This adds support for the i?86-*-elfiamcu triple, which indicates the IAMCU psABI is used.
Differential Revision: http://reviews.llvm.org/D13977
Modified:
llvm/trunk/include/llvm/ADT/Triple.h
llvm/trunk/lib/Support/Triple.cpp
llvm/trunk/lib/Target/X86/X86Subtarget.h
llvm/trunk/unittests/ADT/TripleTest.cpp
Modified: llvm/trunk/include/llvm/ADT/Triple.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/Triple.h?rev=251222&r1=251221&r2=251222&view=diff
==============================================================================
--- llvm/trunk/include/llvm/ADT/Triple.h (original)
+++ llvm/trunk/include/llvm/ADT/Triple.h Sun Oct 25 03:07:37 2015
@@ -174,7 +174,8 @@ public:
Cygnus,
AMDOpenCL,
CoreCLR,
- LastEnvironmentType = CoreCLR
+ ELFIAMCU,
+ LastEnvironmentType = ELFIAMCU
};
enum ObjectFormatType {
UnknownObjectFormat,
@@ -431,6 +432,10 @@ public:
return getOS() == Triple::Bitrig;
}
+ bool isEnvironmentIAMCU() const {
+ return getEnvironment() == Triple::ELFIAMCU;
+ }
+
bool isWindowsMSVCEnvironment() const {
return getOS() == Triple::Win32 &&
(getEnvironment() == Triple::UnknownEnvironment ||
Modified: llvm/trunk/lib/Support/Triple.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/Triple.cpp?rev=251222&r1=251221&r2=251222&view=diff
==============================================================================
--- llvm/trunk/lib/Support/Triple.cpp (original)
+++ llvm/trunk/lib/Support/Triple.cpp Sun Oct 25 03:07:37 2015
@@ -202,6 +202,7 @@ const char *Triple::getEnvironmentTypeNa
case Cygnus: return "cygnus";
case AMDOpenCL: return "amdopencl";
case CoreCLR: return "coreclr";
+ case ELFIAMCU: return "elfiamcu";
}
llvm_unreachable("Invalid EnvironmentType!");
@@ -453,6 +454,7 @@ static Triple::EnvironmentType parseEnvi
.StartsWith("cygnus", Triple::Cygnus)
.StartsWith("amdopencl", Triple::AMDOpenCL)
.StartsWith("coreclr", Triple::CoreCLR)
+ .StartsWith("elfiamcu", Triple::ELFIAMCU)
.Default(Triple::UnknownEnvironment);
}
Modified: llvm/trunk/lib/Target/X86/X86Subtarget.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86Subtarget.h?rev=251222&r1=251221&r2=251222&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86Subtarget.h (original)
+++ llvm/trunk/lib/Target/X86/X86Subtarget.h Sun Oct 25 03:07:37 2015
@@ -418,6 +418,7 @@ public:
bool isTargetNaCl() const { return TargetTriple.isOSNaCl(); }
bool isTargetNaCl32() const { return isTargetNaCl() && !is64Bit(); }
bool isTargetNaCl64() const { return isTargetNaCl() && is64Bit(); }
+ bool isTargetMCU() const { return TargetTriple.isEnvironmentIAMCU(); }
bool isTargetWindowsMSVC() const {
return TargetTriple.isWindowsMSVCEnvironment();
Modified: llvm/trunk/unittests/ADT/TripleTest.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/ADT/TripleTest.cpp?rev=251222&r1=251221&r2=251222&view=diff
==============================================================================
--- llvm/trunk/unittests/ADT/TripleTest.cpp (original)
+++ llvm/trunk/unittests/ADT/TripleTest.cpp Sun Oct 25 03:07:37 2015
@@ -81,6 +81,12 @@ TEST(TripleTest, ParsedIDs) {
EXPECT_EQ(Triple::Darwin, T.getOS());
EXPECT_EQ(Triple::UnknownEnvironment, T.getEnvironment());
+ T = Triple("i386-pc-linux-elfiamcu");
+ EXPECT_EQ(Triple::x86, T.getArch());
+ EXPECT_EQ(Triple::PC, T.getVendor());
+ EXPECT_EQ(Triple::Linux, T.getOS());
+ EXPECT_EQ(Triple::ELFIAMCU, T.getEnvironment());
+
T = Triple("x86_64-pc-linux-gnu");
EXPECT_EQ(Triple::x86_64, T.getArch());
EXPECT_EQ(Triple::PC, T.getVendor());
More information about the llvm-commits
mailing list