@@ -24,6 +24,7 @@ def isNotOSWindows : RuntimeLibcallPredicate<"!TT.isOSWindows()">;
2424def isNotOSLinux : RuntimeLibcallPredicate<[{!TT.isOSLinux()}]>;
2525def isNotOSMSVCRT : RuntimeLibcallPredicate<"!TT.isOSMSVCRT()">;
2626def isPS : RuntimeLibcallPredicate<"TT.isPS()">;
27+ def isMacOSX : RuntimeLibcallPredicate<[{TT.isMacOSX()}]>;
2728def isNotOSWindowsOrIsCygwinMinGW
2829 : RuntimeLibcallPredicate<"!TT.isOSWindows() || TT.isOSCygMing()">;
2930def isWindowsMSVCEnvironment : RuntimeLibcallPredicate<
@@ -1982,6 +1983,10 @@ defvar DarwinMemsetPattern = LibcallImpls<(add memset_pattern4,
19821983 memset_pattern16),
19831984 darwinHasMemsetPattern>;
19841985
1986+ defvar MacOSUnlockedIO = LibcallImpls<(add
1987+ getc_unlocked, getchar_unlocked, putc_unlocked, putchar_unlocked),
1988+ isMacOSX>;
1989+
19851990defvar SecurityCheckCookieIfWinMSVC =
19861991 LibcallImpls<(add __security_check_cookie, __security_cookie),
19871992 isWindowsMSVCOrItaniumEnvironment>;
@@ -2140,6 +2145,7 @@ def AArch64SystemLibrary : SystemRuntimeLibrary<
21402145 LibcallImpls<(add Int128RTLibcalls), isAArch64_ILP64>,
21412146 LibcallImpls<(add bzero), isOSDarwin>,
21422147 DarwinExp10, DarwinSinCosStret, DarwinMemsetPattern,
2148+ MacOSUnlockedIO,
21432149 LibmHasSinCosF32, LibmHasSinCosF64, LibmHasSinCosF128,
21442150 DefaultLibmExp10,
21452151 DefaultStackProtector,
@@ -3294,7 +3300,7 @@ defvar MemChkLibcalls = [__memcpy_chk, __memset_chk, __memmove_chk];
32943300
32953301defvar X86CommonLibcalls =
32963302 (add (sub WinDefaultLibcallImpls, WindowsDivRemMulLibcallOverrides, MemChkLibcalls),
3297- DarwinSinCosStret, DarwinExp10, DarwinMemsetPattern,
3303+ DarwinSinCosStret, DarwinExp10, DarwinMemsetPattern, MacOSUnlockedIO,
32983304 X86_F128_Libcalls,
32993305 LibmHasSinCosF80, // FIXME: Depends on long double
33003306 SinCosF32F64Libcalls,
0 commit comments