Skip to content

Commit

Permalink
[Clang][OHOS] Keep ARM ABI selection logic in sync between Clang and …
Browse files Browse the repository at this point in the history
…LLVM (#68656)
  • Loading branch information
brad0 committed Oct 22, 2023
1 parent 1f12223 commit a63dc79
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion clang/lib/Basic/Targets/ARM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down Expand Up @@ -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");
Expand Down
1 change: 1 addition & 0 deletions llvm/lib/TargetParser/ARMTargetParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit a63dc79

Please sign in to comment.