[clang-tidy] openmp-exception-escape - a new check
authorRoman Lebedev <lebedev.ri@gmail.com>
Fri, 22 Mar 2019 19:46:25 +0000 (19:46 +0000)
committerRoman Lebedev <lebedev.ri@gmail.com>
Fri, 22 Mar 2019 19:46:25 +0000 (19:46 +0000)
commit462446fd9a5d85458f1c61de353ce679ff5dbf9b
tree027c2bd07b528d1fd3a5c8edfb06dea6171acafe
parentcbbf92825f0d7a2b6925e93b58705443345ab57a
[clang-tidy] openmp-exception-escape - a new check

Summary:
Finally, we are here!

Analyzes OpenMP Structured Blocks and checks that no exception escapes
out of the Structured Block it was thrown in.

As per the OpenMP specification, structured block is an executable statement,
possibly compound, with a single entry at the top and a single exit at the
bottom. Which means, ``throw`` may not be used to to 'exit' out of the
structured block. If an exception is not caught in the same structured block
it was thrown in, the behaviour is undefined / implementation defined,
the program will likely terminate.

Reviewers: JonasToth, aaron.ballman, baloghadamsoftware, gribozavr

Reviewed By: aaron.ballman, gribozavr

Subscribers: mgorny, xazax.hun, rnkovacs, guansong, jdoerfert, cfe-commits, ABataev

Tags: #clang-tools-extra, #openmp, #clang

Differential Revision: https://reviews.llvm.org/D59466

llvm-svn: 356802
clang-tools-extra/clang-tidy/openmp/CMakeLists.txt
clang-tools-extra/clang-tidy/openmp/ExceptionEscapeCheck.cpp [new file with mode: 0644]
clang-tools-extra/clang-tidy/openmp/ExceptionEscapeCheck.h [new file with mode: 0644]
clang-tools-extra/clang-tidy/openmp/OpenMPTidyModule.cpp
clang-tools-extra/clang-tidy/utils/ExceptionAnalyzer.cpp
clang-tools-extra/clang-tidy/utils/ExceptionAnalyzer.h
clang-tools-extra/docs/ReleaseNotes.rst
clang-tools-extra/docs/clang-tidy/checks/list.rst
clang-tools-extra/docs/clang-tidy/checks/openmp-exception-escape.rst [new file with mode: 0644]
clang-tools-extra/test/clang-tidy/bugprone-exception-escape-openmp.cpp [new file with mode: 0644]
clang-tools-extra/test/clang-tidy/openmp-exception-escape.cpp [new file with mode: 0644]