diff options
author | Yaxun (Sam) Liu <yaxun.liu@amd.com> | 2020-02-16 21:38:03 -0500 |
---|---|---|
committer | Yaxun (Sam) Liu <yaxun.liu@amd.com> | 2020-02-16 22:44:33 -0500 |
commit | 1b978ddba05cb15e22b4e75adb5e7362ad861987 (patch) | |
tree | ee75220a21b8e51bab0b40c58b6959411d03518a /clang/lib/Sema/SemaCUDA.cpp | |
parent | e8e078c8bf7987b95298062a644bac9eed26f988 (diff) | |
download | llvm-1b978ddba05cb15e22b4e75adb5e7362ad861987.zip llvm-1b978ddba05cb15e22b4e75adb5e7362ad861987.tar.gz llvm-1b978ddba05cb15e22b4e75adb5e7362ad861987.tar.bz2 |
[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
Diffstat (limited to 'clang/lib/Sema/SemaCUDA.cpp')
-rw-r--r-- | clang/lib/Sema/SemaCUDA.cpp | 19 |
1 files changed, 0 insertions, 19 deletions
diff --git a/clang/lib/Sema/SemaCUDA.cpp b/clang/lib/Sema/SemaCUDA.cpp index 0c61057..13b72c4 100644 --- a/clang/lib/Sema/SemaCUDA.cpp +++ b/clang/lib/Sema/SemaCUDA.cpp @@ -674,25 +674,6 @@ bool Sema::CheckCUDACall(SourceLocation Loc, FunctionDecl *Callee) { // Otherwise, mark the call in our call graph so we can traverse it later. bool CallerKnownEmitted = getEmissionStatus(Caller) == FunctionEmissionStatus::Emitted; - if (CallerKnownEmitted) { - // Host-side references to a __global__ function refer to the stub, so the - // function itself is never emitted and therefore should not be marked. - if (!shouldIgnoreInHostDeviceCheck(Callee)) - markKnownEmitted( - *this, Caller, Callee, Loc, [](Sema &S, FunctionDecl *FD) { - return S.getEmissionStatus(FD) == FunctionEmissionStatus::Emitted; - }); - } else { - // If we have - // host fn calls kernel fn calls host+device, - // the HD function does not get instantiated on the host. We model this by - // omitting at the call to the kernel from the callgraph. This ensures - // that, when compiling for host, only HD functions actually called from the - // host get marked as known-emitted. - if (!shouldIgnoreInHostDeviceCheck(Callee)) - DeviceCallGraph[Caller].insert({Callee, Loc}); - } - DeviceDiagBuilder::Kind DiagKind = [this, Caller, Callee, CallerKnownEmitted] { switch (IdentifyCUDAPreference(Caller, Callee)) { |