diff options
author | Alexey Bataev <a.bataev@hotmail.com> | 2015-03-10 04:22:11 +0000 |
---|---|---|
committer | Alexey Bataev <a.bataev@hotmail.com> | 2015-03-10 04:22:11 +0000 |
commit | 7ab2cc178fd68568146d21e320733885bde3687c (patch) | |
tree | ef5f0588ad173b79579d479241e3a4889e928e9d /clang/lib/CodeGen/CGOpenMPRuntime.cpp | |
parent | 760bf9520ad1ec7a487ea1244c5c97ea235e4532 (diff) | |
download | bcm5719-llvm-7ab2cc178fd68568146d21e320733885bde3687c.tar.gz bcm5719-llvm-7ab2cc178fd68568146d21e320733885bde3687c.zip |
[OPENMP] Improved code for generating debug info + generation of all OpenMP regions in termination scope
Patch adds proper generation of debug info for all OpenMP regions. Also, all OpenMP regions are generated in a termination scope, because standard does not allow to throw exceptions out of structured blocks, associated with the OpenMP regions
Differential Revision: http://reviews.llvm.org/D7935
llvm-svn: 231752
Diffstat (limited to 'clang/lib/CodeGen/CGOpenMPRuntime.cpp')
-rw-r--r-- | clang/lib/CodeGen/CGOpenMPRuntime.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CGOpenMPRuntime.cpp b/clang/lib/CodeGen/CGOpenMPRuntime.cpp index 51865a6141f..59a0b27f168 100644 --- a/clang/lib/CodeGen/CGOpenMPRuntime.cpp +++ b/clang/lib/CodeGen/CGOpenMPRuntime.cpp @@ -1047,9 +1047,16 @@ InlinedOpenMPRegionRAII::InlinedOpenMPRegionRAII( CodeGenFunction &CGF, const OMPExecutableDirective &D) : CGF(CGF) { CGF.CapturedStmtInfo = new CGOpenMPInlinedRegionInfo(D, CGF.CapturedStmtInfo); + // 1.2.2 OpenMP Language Terminology + // Structured block - An executable statement with a single entry at the + // top and a single exit at the bottom. + // The point of exit cannot be a branch out of the structured block. + // longjmp() and throw() must not violate the entry/exit criteria. + CGF.EHStack.pushTerminate(); } InlinedOpenMPRegionRAII::~InlinedOpenMPRegionRAII() { + CGF.EHStack.popTerminate(); auto *OldCSI = cast<CGOpenMPInlinedRegionInfo>(CGF.CapturedStmtInfo)->getOldCSI(); delete CGF.CapturedStmtInfo; |