summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Simbuerger <simbuerg@fim.uni-passau.de>2014-06-12 07:25:08 +0000
committerAndreas Simbuerger <simbuerg@fim.uni-passau.de>2014-06-12 07:25:08 +0000
commit83ed861ea2512d6dd8a99db08bc35e1e90617f99 (patch)
tree221fa157c59cb52fa075dac705add2a55b96e9aa
parentfbd643c9e182a908dce232305d7d86d85957f222 (diff)
downloadbcm5719-llvm-83ed861ea2512d6dd8a99db08bc35e1e90617f99.tar.gz
bcm5719-llvm-83ed861ea2512d6dd8a99db08bc35e1e90617f99.zip
Check for an empty error log.
Fixes #19976. The error log does not contain an error, in case we reject a candidate without generating a diagnostic message by using invalid<>(...). This is the case for the top-level region of a function. The patch comes without a test-case because adding a useful one requires additional code just for triggering it. Before the patch it would only trigger, if we try to print the CFG with Scop error annotations. llvm-svn: 210753
-rw-r--r--polly/lib/Analysis/ScopDetection.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/polly/lib/Analysis/ScopDetection.cpp b/polly/lib/Analysis/ScopDetection.cpp
index 8a9226e6331..f1fafaabd58 100644
--- a/polly/lib/Analysis/ScopDetection.cpp
+++ b/polly/lib/Analysis/ScopDetection.cpp
@@ -219,7 +219,14 @@ std::string ScopDetection::regionIsInvalidBecause(const Region *R) const {
// Get the first error we found. Even in keep-going mode, this is the first
// reason that caused the candidate to be rejected.
RejectLog Errors = RejectLogs.at(R);
- return (*Errors.begin())->getMessage();
+
+ // This can happen when we marked a region invalid, but didn't track
+ // an error for it.
+ if (Errors.size() == 0)
+ return "";
+
+ RejectReasonPtr RR = *Errors.begin();
+ return RR->getMessage();
}
bool ScopDetection::isValidCFG(BasicBlock &BB,
OpenPOWER on IntegriCloud