summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support
diff options
context:
space:
mode:
authorJason Liu <jasonliu.development@gmail.com>2019-03-12 22:01:10 +0000
committerJason Liu <jasonliu.development@gmail.com>2019-03-12 22:01:10 +0000
commita03ae73c2932c1795830bfbf6e6b8e87baf8aa3a (patch)
tree9c2c19c6aa70463cb1c3e3d5f150fe4af8759715 /llvm/lib/Support
parentd425d6b08b9b6844ab164234ec6e5b5de107b4fa (diff)
downloadbcm5719-llvm-a03ae73c2932c1795830bfbf6e6b8e87baf8aa3a.tar.gz
bcm5719-llvm-a03ae73c2932c1795830bfbf6e6b8e87baf8aa3a.zip
Add XCOFF triple object format type for AIX
This patch adds an XCOFF triple object format type into LLVM. This XCOFF triple object file type will be used later by object file and assembly generation for the AIX platform. Differential Revision: https://reviews.llvm.org/D58930 llvm-svn: 355989
Diffstat (limited to 'llvm/lib/Support')
-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 ab9fcccd5c4..83ce4f0f122 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:
OpenPOWER on IntegriCloud