]> granicus.if.org Git - clang/commit
[OpenMP] Check for associated statements with hasAssociatedStmt() when scanning for...
authorSamuel Antao <sfantao@us.ibm.com>
Sun, 8 May 2016 06:43:56 +0000 (06:43 +0000)
committerSamuel Antao <sfantao@us.ibm.com>
Sun, 8 May 2016 06:43:56 +0000 (06:43 +0000)
commit6c54b436335f35154ee8a1d27790943ce992f5ec
treefb9eb386773a2546b650f3604809a8e308751fc8
parent0070045e6758c82d73771d601995b8a31020254f
[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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@268870 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/CGOpenMPRuntime.cpp
test/OpenMP/target_enter_data_codegen.cpp