[PATCH] D13977: [X86] Add elfiamcu triple support, and a workaround for PR3997
Michael Kuperstein via llvm-commits
llvm-commits at lists.llvm.org
Sun Oct 25 01:10:00 PDT 2015
This revision was automatically updated to reflect the committed changes.
Closed by commit rL251222: [X86] Add support for elfiamcu triple (authored by mkuper).
Changed prior to commit:
http://reviews.llvm.org/D13977?vs=38101&id=38340#toc
Repository:
rL LLVM
http://reviews.llvm.org/D13977
Files:
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
Index: llvm/trunk/include/llvm/ADT/Triple.h
===================================================================
--- llvm/trunk/include/llvm/ADT/Triple.h
+++ llvm/trunk/include/llvm/ADT/Triple.h
@@ -174,7 +174,8 @@
Cygnus,
AMDOpenCL,
CoreCLR,
- LastEnvironmentType = CoreCLR
+ ELFIAMCU,
+ LastEnvironmentType = ELFIAMCU
};
enum ObjectFormatType {
UnknownObjectFormat,
@@ -431,6 +432,10 @@
return getOS() == Triple::Bitrig;
}
+ bool isEnvironmentIAMCU() const {
+ return getEnvironment() == Triple::ELFIAMCU;
+ }
+
bool isWindowsMSVCEnvironment() const {
return getOS() == Triple::Win32 &&
(getEnvironment() == Triple::UnknownEnvironment ||
Index: llvm/trunk/lib/Support/Triple.cpp
===================================================================
--- llvm/trunk/lib/Support/Triple.cpp
+++ llvm/trunk/lib/Support/Triple.cpp
@@ -202,6 +202,7 @@
case Cygnus: return "cygnus";
case AMDOpenCL: return "amdopencl";
case CoreCLR: return "coreclr";
+ case ELFIAMCU: return "elfiamcu";
}
llvm_unreachable("Invalid EnvironmentType!");
@@ -453,6 +454,7 @@
.StartsWith("cygnus", Triple::Cygnus)
.StartsWith("amdopencl", Triple::AMDOpenCL)
.StartsWith("coreclr", Triple::CoreCLR)
+ .StartsWith("elfiamcu", Triple::ELFIAMCU)
.Default(Triple::UnknownEnvironment);
}
Index: llvm/trunk/lib/Target/X86/X86Subtarget.h
===================================================================
--- llvm/trunk/lib/Target/X86/X86Subtarget.h
+++ llvm/trunk/lib/Target/X86/X86Subtarget.h
@@ -418,6 +418,7 @@
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();
Index: llvm/trunk/unittests/ADT/TripleTest.cpp
===================================================================
--- llvm/trunk/unittests/ADT/TripleTest.cpp
+++ llvm/trunk/unittests/ADT/TripleTest.cpp
@@ -81,6 +81,12 @@
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());
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D13977.38340.patch
Type: text/x-patch
Size: 2632 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20151025/55540c60/attachment.bin>
More information about the llvm-commits
mailing list