Skip to content

Commit 62d3685

Browse files
authored
RuntimeLibcalls: Cleanup darwin bzero configuration (#145639)
Write this in a more predicate-apply style instead of the switch.
1 parent 9e8152b commit 62d3685

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

llvm/lib/IR/RuntimeLibcalls.cpp

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -432,19 +432,11 @@ void RuntimeLibcallsInfo::initLibcalls(const Triple &TT,
432432
setLibcallName(RTLIB::FPROUND_F32_F16, "__truncsfhf2");
433433

434434
// Some darwins have an optimized __bzero/bzero function.
435-
switch (TT.getArch()) {
436-
case Triple::x86:
437-
case Triple::x86_64:
435+
if (TT.isX86()) {
438436
if (TT.isMacOSX() && !TT.isMacOSXVersionLT(10, 6))
439437
setLibcallName(RTLIB::BZERO, "__bzero");
440-
break;
441-
case Triple::aarch64:
442-
case Triple::aarch64_32:
438+
} else if (TT.isAArch64())
443439
setLibcallName(RTLIB::BZERO, "bzero");
444-
break;
445-
default:
446-
break;
447-
}
448440

449441
if (darwinHasSinCosStret(TT)) {
450442
setLibcallName(RTLIB::SINCOS_STRET_F32, "__sincosf_stret");

0 commit comments

Comments
 (0)