[llvm] a63dc79 - [Clang][OHOS] Keep ARM ABI selection logic in sync between Clang and LLVM (#68656)
via llvm-commits
llvm-commits at lists.llvm.org
Sat Oct 21 22:48:46 PDT 2023
Author: Brad Smith
Date: 2023-10-22T08:48:41+03:00
New Revision: a63dc79d113915048c932eca7732838206898e9a
URL: https://github.com/llvm/llvm-project/commit/a63dc79d113915048c932eca7732838206898e9a
DIFF: https://github.com/llvm/llvm-project/commit/a63dc79d113915048c932eca7732838206898e9a.diff
LOG: [Clang][OHOS] Keep ARM ABI selection logic in sync between Clang and LLVM (#68656)
Added:
Modified:
clang/lib/Basic/Targets/ARM.cpp
llvm/lib/TargetParser/ARMTargetParser.cpp
Removed:
################################################################################
diff --git a/clang/lib/Basic/Targets/ARM.cpp b/clang/lib/Basic/Targets/ARM.cpp
index 1e809283748b66c..ce7e4d4639ceacb 100644
--- a/clang/lib/Basic/Targets/ARM.cpp
+++ b/clang/lib/Basic/Targets/ARM.cpp
@@ -258,6 +258,7 @@ ARMTargetInfo::ARMTargetInfo(const llvm::Triple &Triple,
bool IsOpenBSD = Triple.isOSOpenBSD();
bool IsNetBSD = Triple.isOSNetBSD();
bool IsHaiku = Triple.isOSHaiku();
+ bool IsOHOS = Triple.isOHOSFamily();
// FIXME: the isOSBinFormatMachO is a workaround for identifying a Darwin-like
// environment where size_t is `unsigned long` rather than `unsigned int`
@@ -324,7 +325,7 @@ ARMTargetInfo::ARMTargetInfo(const llvm::Triple &Triple,
default:
if (IsNetBSD)
setABI("apcs-gnu");
- else if (IsFreeBSD || IsOpenBSD || IsHaiku)
+ else if (IsFreeBSD || IsOpenBSD || IsHaiku || IsOHOS)
setABI("aapcs-linux");
else
setABI("aapcs");
diff --git a/llvm/lib/TargetParser/ARMTargetParser.cpp b/llvm/lib/TargetParser/ARMTargetParser.cpp
index 4517f714527db15..d09992441909e01 100644
--- a/llvm/lib/TargetParser/ARMTargetParser.cpp
+++ b/llvm/lib/TargetParser/ARMTargetParser.cpp
@@ -559,6 +559,7 @@ StringRef ARM::computeDefaultTargetABI(const Triple &TT, StringRef CPU) {
case Triple::GNUEABIHF:
case Triple::MuslEABI:
case Triple::MuslEABIHF:
+ case Triple::OpenHOS:
return "aapcs-linux";
case Triple::EABIHF:
case Triple::EABI:
More information about the llvm-commits
mailing list