aboutsummaryrefslogtreecommitdiff
path: root/contrib/llvm-project/clang/lib/Basic
diff options
context:
space:
mode:
authorJustin Hibbits <jhibbits@FreeBSD.org>2019-12-27 04:00:04 +0000
committerJustin Hibbits <jhibbits@FreeBSD.org>2019-12-27 04:00:04 +0000
commite4399d169acc4da249b152cd0315f39531e816ea (patch)
tree7b293036126306b6ee41634c238476f3f370c5c8 /contrib/llvm-project/clang/lib/Basic
parent678da4a274472392c240f53306e7d06644077c61 (diff)
downloadsrc-e4399d169acc4da249b152cd0315f39531e816ea.tar.gz
src-e4399d169acc4da249b152cd0315f39531e816ea.zip
Notes
Diffstat (limited to 'contrib/llvm-project/clang/lib/Basic')
-rw-r--r--contrib/llvm-project/clang/lib/Basic/Targets/PPC.h21
1 files changed, 19 insertions, 2 deletions
diff --git a/contrib/llvm-project/clang/lib/Basic/Targets/PPC.h b/contrib/llvm-project/clang/lib/Basic/Targets/PPC.h
index 6c6421c28e23..72a82f0ed7c7 100644
--- a/contrib/llvm-project/clang/lib/Basic/Targets/PPC.h
+++ b/contrib/llvm-project/clang/lib/Basic/Targets/PPC.h
@@ -375,12 +375,29 @@ public:
IntMaxType = SignedLong;
Int64Type = SignedLong;
+ if (Triple.getEnvironment() != llvm::Triple::UnknownEnvironment) {
+ switch (Triple.getEnvironment()){
+ case llvm::Triple::ELFv1:
+ ABI = "elfv1";
+ break;
+ default:
+ ABI = "elfv2";
+ break;
+ }
+ } else {
+ if ((Triple.getOS() == llvm::Triple::FreeBSD) &&
+ (Triple.getOSMajorVersion() < 13)) {
+ ABI = "elfv1";
+ } else {
+ ABI = "elfv2";
+ }
+ }
+
+
if ((Triple.getArch() == llvm::Triple::ppc64le)) {
resetDataLayout("e-m:e-i64:64-n32:64");
- ABI = "elfv2";
} else {
resetDataLayout("E-m:e-i64:64-n32:64");
- ABI = Triple.getEnvironment() == llvm::Triple::ELFv2 ? "elfv2" : "elfv1";
}
if (Triple.getOS() == llvm::Triple::AIX)