Skip to content

Commit 7795be6

Browse files
committed
Invert condition
1 parent 226c6e5 commit 7795be6

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

llvm/include/llvm/CodeGen/LibcallLoweringInfo.h

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,12 @@ class LibcallLoweringInfo {
5454
/// unsupported.
5555
LLVM_ABI StringRef getMemcpyName() const {
5656
RTLIB::LibcallImpl Memcpy = getLibcallImpl(RTLIB::MEMCPY);
57-
if (Memcpy != RTLIB::Unsupported)
58-
return RTLIB::RuntimeLibcallsInfo::getLibcallImplName(Memcpy);
57+
if (Memcpy == RTLIB::Unsupported) {
58+
// Fallback to memmove if memcpy isn't available.
59+
return getLibcallName(RTLIB::MEMMOVE);
60+
}
5961

60-
// Fallback to memmove if memcpy isn't available.
61-
return getLibcallName(RTLIB::MEMMOVE);
62+
return RTLIB::RuntimeLibcallsInfo::getLibcallImplName(Memcpy);
6263
}
6364
};
6465

0 commit comments

Comments
 (0)