[OpenMP] Delay more diagnostics of potentially non-emitted code
authorJohannes Doerfert <johannes@jdoerfert.de>
Tue, 2 Feb 2021 17:17:44 +0000 (11:17 -0600)
committerJohannes Doerfert <johannes@jdoerfert.de>
Mon, 15 Feb 2021 19:17:05 +0000 (13:17 -0600)
commit1dd66e6111a8247c6c7931143251c0cf1442b905
tree511cee5e52bcb18136d9eb8685e12df8d9ec6fb6
parentf9286b434b764b366f1aad9249c04e7741ed5518
[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
clang/lib/Sema/SemaDecl.cpp
clang/lib/Sema/SemaOpenMP.cpp
clang/test/OpenMP/nvptx_allocate_messages.cpp
clang/test/OpenMP/nvptx_target_exceptions_messages.cpp
clang/test/OpenMP/nvptx_unsupported_type_messages.cpp