Skip to content

Commit e1d893f

Browse files
committed
[Triple] Make mipsel-*-windows-* use COFF files by default
Windows NT/MIPS and Windows CE/MIPS always used COFF format.
1 parent 98cf656 commit e1d893f

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

llvm/lib/TargetParser/Triple.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -905,7 +905,6 @@ static Triple::ObjectFormatType getDefaultFormat(const Triple &T) {
905905
case Triple::mips64:
906906
case Triple::mips64el:
907907
case Triple::mips:
908-
case Triple::mipsel:
909908
case Triple::msp430:
910909
case Triple::nvptx64:
911910
case Triple::nvptx:
@@ -930,6 +929,11 @@ static Triple::ObjectFormatType getDefaultFormat(const Triple &T) {
930929
case Triple::xtensa:
931930
return Triple::ELF;
932931

932+
case Triple::mipsel:
933+
if (T.isOSWindows())
934+
return Triple::COFF;
935+
return Triple::ELF;
936+
933937
case Triple::ppc64:
934938
case Triple::ppc:
935939
if (T.isOSAIX())

llvm/unittests/TargetParser/TripleTest.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2302,6 +2302,10 @@ TEST(TripleTest, NormalizeWindows) {
23022302
Triple::normalize("i686-pc-windows-elf-elf"));
23032303

23042304
EXPECT_TRUE(Triple("x86_64-pc-win32").isWindowsMSVCEnvironment());
2305+
2306+
EXPECT_TRUE(Triple(Triple::normalize("mipsel-windows-msvccoff")).isOSBinFormatCOFF());
2307+
EXPECT_TRUE(Triple(Triple::normalize("mipsel-windows-msvc")).isOSBinFormatCOFF());
2308+
EXPECT_TRUE(Triple(Triple::normalize("mipsel-windows-gnu")).isOSBinFormatCOFF());
23052309
}
23062310

23072311
TEST(TripleTest, NormalizeAndroid) {

0 commit comments

Comments
 (0)