aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Support/Triple.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Support/Triple.cpp')
-rw-r--r--llvm/lib/Support/Triple.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/lib/Support/Triple.cpp b/llvm/lib/Support/Triple.cpp
index ab9fccc..83ce4f0 100644
--- a/llvm/lib/Support/Triple.cpp
+++ b/llvm/lib/Support/Triple.cpp
@@ -534,6 +534,9 @@ static Triple::EnvironmentType parseEnvironment(StringRef EnvironmentName) {
static Triple::ObjectFormatType parseFormat(StringRef EnvironmentName) {
return StringSwitch<Triple::ObjectFormatType>(EnvironmentName)
+ // "xcoff" must come before "coff" because of the order-dependendent
+ // pattern matching.
+ .EndsWith("xcoff", Triple::XCOFF)
.EndsWith("coff", Triple::COFF)
.EndsWith("elf", Triple::ELF)
.EndsWith("macho", Triple::MachO)
@@ -622,6 +625,7 @@ static StringRef getObjectFormatTypeName(Triple::ObjectFormatType Kind) {
case Triple::ELF: return "elf";
case Triple::MachO: return "macho";
case Triple::Wasm: return "wasm";
+ case Triple::XCOFF: return "xcoff";
}
llvm_unreachable("unknown object format type");
}
@@ -686,6 +690,8 @@ static Triple::ObjectFormatType getDefaultFormat(const Triple &T) {
case Triple::ppc64:
if (T.isOSDarwin())
return Triple::MachO;
+ else if (T.isOSAIX())
+ return Triple::XCOFF;
return Triple::ELF;
case Triple::wasm32: