forked from OSchip/llvm-project
[PlaceSafepoints] Assert that the gc.safepoint_poll function is present in the module.
If running the PlaceSafepoints pass on a module which doesn't have the gc.safepoint_poll function without disabling entry and backedge safepoints, previously the pass crashed with an obscure error because of a null pointer. Now it fails the assert instead. llvm-svn: 256580
This commit is contained in:
parent
7a7abc9a3b
commit
e3773d632e
|
@ -762,6 +762,7 @@ InsertSafepointPoll(Instruction *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->getType()->getElementType() ==
|
||||
FunctionType::get(Type::getVoidTy(M->getContext()), false) &&
|
||||
"gc.safepoint_poll declared with wrong type");
|
||||
|
|
Loading…
Reference in New Issue