mirror of
https://github.com/RPCS3/llvm.git
synced 2025-02-07 19:19:26 +00:00
[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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256580 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
733af2eb65
commit
df4a54ad91
@ -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…
x
Reference in New Issue
Block a user