summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
diff options
context:
space:
mode:
authorPhilip Reames <listmail@philipreames.com>2015-02-20 18:56:14 +0000
committerPhilip Reames <listmail@philipreames.com>2015-02-20 18:56:14 +0000
commit2ef029c7ae2d3ef31d71b179035a3f59f6b77386 (patch)
tree9bdc8d4513d78f31cbf50a85cf1be9b087423354 /llvm/lib/Transforms
parent9cda4b7ed941750dde35d9a289a5c00aa1f6c872 (diff)
downloadbcm5719-llvm-2ef029c7ae2d3ef31d71b179035a3f59f6b77386.tar.gz
bcm5719-llvm-2ef029c7ae2d3ef31d71b179035a3f59f6b77386.zip
Bugfix for 229954
Before calling Function::getGC to test for enablement, we need to make sure there's actually a GC at all via Function::hasGC. Otherwise, we'd crash on functions without a GC. Thankfully, this only mattered if you manually scheduled the pass, but still, oops. :( llvm-svn: 230040
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r--llvm/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp b/llvm/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp
index 052a149ae26..e3859bcb673 100644
--- a/llvm/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp
+++ b/llvm/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp
@@ -1911,8 +1911,11 @@ static bool insertParsePoints(Function &F, DominatorTree &DT, Pass *P,
/// point of this function is as an extension point for custom logic.
static bool shouldRewriteStatepointsIn(Function &F) {
// TODO: This should check the GCStrategy
- const std::string StatepointExampleName("statepoint-example");
- return StatepointExampleName == F.getGC();
+ if (F.hasGC()) {
+ const std::string StatepointExampleName("statepoint-example");
+ return StatepointExampleName == F.getGC();
+ } else
+ return false;
}
bool RewriteStatepointsForGC::runOnFunction(Function &F) {
OpenPOWER on IntegriCloud