diff options
author | Manuel Jacob <me@manueljacob.de> | 2015-12-29 21:57:55 +0000 |
---|---|---|
committer | Manuel Jacob <me@manueljacob.de> | 2015-12-29 21:57:55 +0000 |
commit | e3773d632e74f9dbadd1aeff7f6cfab7411349a7 (patch) | |
tree | cc7ddd85f4ae808060a93e4e190ce651f8945b76 /llvm/lib/Transforms/Scalar/PlaceSafepoints.cpp | |
parent | 7a7abc9a3b090724416b4a142e0a076fbaebb77d (diff) | |
download | bcm5719-llvm-e3773d632e74f9dbadd1aeff7f6cfab7411349a7.tar.gz bcm5719-llvm-e3773d632e74f9dbadd1aeff7f6cfab7411349a7.zip |
[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
Diffstat (limited to 'llvm/lib/Transforms/Scalar/PlaceSafepoints.cpp')
-rw-r--r-- | llvm/lib/Transforms/Scalar/PlaceSafepoints.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Scalar/PlaceSafepoints.cpp b/llvm/lib/Transforms/Scalar/PlaceSafepoints.cpp index 7fe286f70c4..28c610c2486 100644 --- a/llvm/lib/Transforms/Scalar/PlaceSafepoints.cpp +++ b/llvm/lib/Transforms/Scalar/PlaceSafepoints.cpp @@ -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"); |