diff --git a/llvm/include/llvm/IR/RuntimeLibcalls.h b/llvm/include/llvm/IR/RuntimeLibcalls.h index 89e466ee5933d..051bcc147cb71 100644 --- a/llvm/include/llvm/IR/RuntimeLibcalls.h +++ b/llvm/include/llvm/IR/RuntimeLibcalls.h @@ -81,9 +81,9 @@ struct RuntimeLibcallsInfo { return LibcallCallingConvs[Call]; } - iterator_range getLibcallNames() { - return llvm::make_range(LibcallRoutineNames, - LibcallRoutineNames + RTLIB::UNKNOWN_LIBCALL); + ArrayRef getLibcallNames() const { + // Trim UNKNOWN_LIBCALL from the end + return ArrayRef(LibcallRoutineNames).drop_back(); } private: