summaryrefslogtreecommitdiffstats
path: root/polly/lib/Support/ScopHelper.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'polly/lib/Support/ScopHelper.cpp')
-rw-r--r--polly/lib/Support/ScopHelper.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/polly/lib/Support/ScopHelper.cpp b/polly/lib/Support/ScopHelper.cpp
index a535f98aa55..69904f0c241 100644
--- a/polly/lib/Support/ScopHelper.cpp
+++ b/polly/lib/Support/ScopHelper.cpp
@@ -331,3 +331,17 @@ Value *polly::expandCodeFor(Scop &S, ScalarEvolution &SE, const DataLayout &DL,
ScopExpander Expander(S.getRegion(), SE, DL, Name);
return Expander.expandCodeFor(E, Ty, IP);
}
+
+bool polly::isErrorBlock(BasicBlock &BB) {
+
+ for (Instruction &Inst : BB)
+ if (CallInst *CI = dyn_cast<CallInst>(&Inst))
+ if (Function *F = CI->getCalledFunction())
+ if (F->getName().equals("__ubsan_handle_out_of_bounds"))
+ return true;
+
+ if (isa<UnreachableInst>(BB.getTerminator()))
+ return true;
+
+ return false;
+}
OpenPOWER on IntegriCloud