OSDN Git Service

[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)
committerTom Stellard <tstellar@redhat.com>
Mon, 15 Feb 2021 19:57:51 +0000 (11:57 -0800)
commit0d14528f8082ba12e34f41cbf931a7e7425b694a
tree29cd591e7f9eb0cd46b8a005694515a86d89976f
parent3b9ea2dc8eeb3c3893213f57d532b32ef3619859
[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

(cherry picked from commit 1dd66e6111a8247c6c7931143251c0cf1442b905)
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