[llvm] [PlaceSafepoints] Report usage error instead of asserting on invalid gc.safepoint_poll (PR #205520)
Gustas Rove via llvm-commits
llvm-commits at lists.llvm.org
Wed Jun 24 06:28:35 PDT 2026
================
@@ -629,11 +629,14 @@ InsertSafepointPoll(BasicBlock::iterator InsertBefore,
// path call - where we need to insert a safepoint (parsepoint).
auto *F = M->getFunction(GCSafepointPollName);
- assert(F && "gc.safepoint_poll function is missing");
- assert(F->getFunctionType() ==
- FunctionType::get(Type::getVoidTy(M->getContext()), false) &&
- "gc.safepoint_poll declared with wrong type");
- assert(!F->empty() && "gc.safepoint_poll must be a non-empty function");
+ if (!F) {
+ reportFatalUsageError("gc.safepoint_poll function is missing");
----------------
TheMixas wrote:
I agree. Reverted the type and empty checks to asserts (I tested and confirmed that neither crash on a non-assertions build). Only kept reportFatalUsageError for the missing-function case.
https://github.com/llvm/llvm-project/pull/205520
More information about the llvm-commits
mailing list