Commit Graph

9 Commits

Author SHA1 Message Date
Johannes Doerfert 1dd66e6111 [OpenMP] Delay more diagnostics of potentially non-emitted code
Even code in target and declare target regions might not be emitted.
With this patch we delay more diagnostics and use laziness and linkage
to determine if a function is emitted (for the device). Note that we
still eagerly emit diagnostics for target regions, unfortunately, see
the TODO for the reason.

This hopefully fixes PR48933.

Reviewed By: JonChesterfield

Differential Revision: https://reviews.llvm.org/D95928
2021-02-15 13:17:05 -06:00
Yaxun (Sam) Liu 5767085c8d Fix infinite recursion in deferred diag emitter
Currently deferred diagnostic emitter checks variable decl in DeclRefExpr, which
causes infinite recursion for cases like long a = (long)&a;.

Deferred diagnostic emitter does not need check variable decls in DeclRefExpr
since reference of a variable does not cause emission of functions directly or
indirectly. Therefore there is no need to check variable decls in DeclRefExpr.

Differential Revision: https://reviews.llvm.org/D76937
2020-04-01 22:17:43 -04:00
Yaxun (Sam) Liu b670ab7b6b recommit 1b978ddba0 [CUDA][HIP][OpenMP] Emit deferred diagnostics by a post-parsing AST travese
Differential Revision: https://reviews.llvm.org/D70172
2020-03-23 12:09:07 -04:00
Yaxun (Sam) Liu bcadb1f2e6 Revert "[CUDA][HIP][OpenMP] Emit deferred diagnostics by a post-parsing AST travese"
This reverts commit 1b978ddba0.
2020-02-18 14:45:34 -05:00
Yaxun (Sam) Liu 1b978ddba0 [CUDA][HIP][OpenMP] Emit deferred diagnostics by a post-parsing AST travese
This patch removes the explicit call graph for CUDA/HIP/OpenMP deferred
diagnostics generated during parsing since it is error prone due to
incomplete information about function declarations during parsing. In stead,
this patch does a post-parsing AST traverse and emits deferred diagnostics
based on the use graph implicitly generated during the traverse.

Differential Revision: https://reviews.llvm.org/D70172
2020-02-16 22:44:33 -05:00
Alexey Bataev c416e64731 [OPENMP]Delay emission of the error messages for the exceptions.
Fixed diagnostic emission for the exceptions support in case of the
compilation of OpenMP code for the devices. From now on, it uses delayed
diagnostics mechanism, previously used for CUDA only. It allow to
diagnose not allowed used of exceptions only in functions that are going
to be codegen'ed.

llvm-svn: 353542
2019-02-08 18:02:25 +00:00
Alexey Bataev 346fb4bbcd Revert "[OPENMP]Initial support for the delayed diagnostics."
This reverts commit r353540. Erroneously committed, need to fix the
message and description.

llvm-svn: 353541
2019-02-08 17:42:00 +00:00
Alexey Bataev 5e62adad0d [OPENMP]Initial support for the delayed diagnostics.
It is important to delay the emission of the diagnostic messages for the
functions unless it is proved that the function is going to be used on
the device side. It is required to support compilation with some of the
target-specific system headers.

llvm-svn: 353540
2019-02-08 17:38:09 +00:00
Alexey Bataev 1ab3457319 [OPENMP] Enable c++ exceptions outside of the target constructs iff they are
enabled for the host.

If the compilation for the host enables C++ exceptions, but they are not
supported by the device, we still need to allow the code with the
exception handling constructs outside of the target regions.

llvm-svn: 331372
2018-05-02 16:52:07 +00:00