summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support/Triple.cpp
diff options
context:
space:
mode:
authorSimon Atanasyan <simon@atanasyan.com>2018-09-27 08:51:18 +0000
committerSimon Atanasyan <simon@atanasyan.com>2018-09-27 08:51:18 +0000
commite58c45a695f39004710b6ce940d489fee800dbd3 (patch)
tree616f6d23a0d14f4586f03e426cea20b995259062 /llvm/lib/Support/Triple.cpp
parent0b339e4d80eaae905f879e26de756b47415fdb02 (diff)
downloadbcm5719-llvm-e58c45a695f39004710b6ce940d489fee800dbd3.tar.gz
bcm5719-llvm-e58c45a695f39004710b6ce940d489fee800dbd3.zip
[mips] Add support MIPS r6 Debian triples
Debian uses different triples for MIPS r6 and paths. Here we use SubArch to determine whether it is r6, if we found `r6' in CPU section of triple. These new triples include: mipsisa32r6-linux-gnu mipsisa32r6el-linux-gnu mipsisa64r6-linux-gnuabi64 mipsisa64r6el-linux-gnuabi64 mipsisa64r6-linux-gnuabin32 mipsisa64r6el-linux-gnuabin32 Patch by YunQiang Su. Differential revision: https://reviews.llvm.org/D50857 llvm-svn: 343185
Diffstat (limited to 'llvm/lib/Support/Triple.cpp')
-rw-r--r--llvm/lib/Support/Triple.cpp31
1 files changed, 20 insertions, 11 deletions
diff --git a/llvm/lib/Support/Triple.cpp b/llvm/lib/Support/Triple.cpp
index 38f72c93bd7..c53c878e9df 100644
--- a/llvm/lib/Support/Triple.cpp
+++ b/llvm/lib/Support/Triple.cpp
@@ -399,10 +399,14 @@ static Triple::ArchType parseArch(StringRef ArchName) {
.Case("thumbeb", Triple::thumbeb)
.Case("avr", Triple::avr)
.Case("msp430", Triple::msp430)
- .Cases("mips", "mipseb", "mipsallegrex", Triple::mips)
- .Cases("mipsel", "mipsallegrexel", Triple::mipsel)
- .Cases("mips64", "mips64eb", "mipsn32", Triple::mips64)
- .Cases("mips64el", "mipsn32el", Triple::mips64el)
+ .Cases("mips", "mipseb", "mipsallegrex", "mipsisa32r6",
+ "mipsr6", Triple::mips)
+ .Cases("mipsel", "mipsallegrexel", "mipsisa32r6el", "mipsr6el",
+ Triple::mipsel)
+ .Cases("mips64", "mips64eb", "mipsn32", "mipsisa64r6",
+ "mips64r6", "mipsn32r6", Triple::mips64)
+ .Cases("mips64el", "mipsn32el", "mipsisa64r6el", "mips64r6el",
+ "mipsn32r6el", Triple::mips64el)
.Case("nios2", Triple::nios2)
.Case("r600", Triple::r600)
.Case("amdgcn", Triple::amdgcn)
@@ -540,6 +544,10 @@ static Triple::ObjectFormatType parseFormat(StringRef EnvironmentName) {
}
static Triple::SubArchType parseSubArch(StringRef SubArchName) {
+ if (SubArchName.startswith("mips") &&
+ (SubArchName.endswith("r6el") || SubArchName.endswith("r6")))
+ return Triple::MipsSubArch_r6;
+
StringRef ARMSubArch = ARM::getCanonicalArchName(SubArchName);
// For now, this is the small part. Early return.
@@ -714,13 +722,14 @@ Triple::Triple(const Twine &Str)
}
}
} else {
- Environment = StringSwitch<Triple::EnvironmentType>(Components[0])
- .StartsWith("mipsn32", Triple::GNUABIN32)
- .StartsWith("mips64", Triple::GNUABI64)
- .StartsWith("mipsisa64", Triple::GNUABI64)
- .StartsWith("mipsisa32", Triple::GNU)
- .Cases("mips", "mipsel", Triple::GNU)
- .Default(UnknownEnvironment);
+ Environment =
+ StringSwitch<Triple::EnvironmentType>(Components[0])
+ .StartsWith("mipsn32", Triple::GNUABIN32)
+ .StartsWith("mips64", Triple::GNUABI64)
+ .StartsWith("mipsisa64", Triple::GNUABI64)
+ .StartsWith("mipsisa32", Triple::GNU)
+ .Cases("mips", "mipsel", "mipsr6", "mipsr6el", Triple::GNU)
+ .Default(UnknownEnvironment);
}
}
if (ObjectFormat == UnknownObjectFormat)
OpenPOWER on IntegriCloud