summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorSamuel Antao <sfantao@us.ibm.com>2016-05-08 06:43:56 +0000
committerSamuel Antao <sfantao@us.ibm.com>2016-05-08 06:43:56 +0000
commite49645cf124413b2bfeeb074ead7d3f3f80f4e23 (patch)
tree881919f3723eff9a871d5fcc52f29103cbef0648 /clang/lib
parent5b5501e81701aaf20bae258b2b8ee3859da0c0a4 (diff)
downloadbcm5719-llvm-e49645cf124413b2bfeeb074ead7d3f3f80f4e23.tar.gz
bcm5719-llvm-e49645cf124413b2bfeeb074ead7d3f3f80f4e23.zip
[OpenMP] Check for associated statements with hasAssociatedStmt() when scanning for device code.
Summary: `getAssociatedStmt()` contains an assertion that assumes the statement always exists. In device code scanning, we need to look into the associated statement therefore we check its existence. This patch replaces `getAssociatedStmt` by `hasAssociatedStmt` so that we do not trigger the assertion for directives that happen not to have an associated statement (e.g target enter/exit data). Reviewers: hfinkel, carlo.bertolli, arpith-jacob, kkwli0, ABataev Subscribers: cfe-commits, caomhin Differential Revision: http://reviews.llvm.org/D19812 llvm-svn: 268870
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/CodeGen/CGOpenMPRuntime.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CGOpenMPRuntime.cpp b/clang/lib/CodeGen/CGOpenMPRuntime.cpp
index a83d0090702..d461bd74fde 100644
--- a/clang/lib/CodeGen/CGOpenMPRuntime.cpp
+++ b/clang/lib/CodeGen/CGOpenMPRuntime.cpp
@@ -5719,7 +5719,7 @@ void CGOpenMPRuntime::scanForTargetRegionsFunctions(const Stmt *S,
}
if (const OMPExecutableDirective *E = dyn_cast<OMPExecutableDirective>(S)) {
- if (!E->getAssociatedStmt())
+ if (!E->hasAssociatedStmt())
return;
scanForTargetRegionsFunctions(
OpenPOWER on IntegriCloud