aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/ExtractAPI/Serialization/SymbolGraphSerializer.cpp
diff options
context:
space:
mode:
authorYaxun (Sam) Liu <yaxun.liu@amd.com>2022-03-15 21:45:02 -0400
committerYaxun (Sam) Liu <yaxun.liu@amd.com>2022-03-24 15:19:47 -0400
commitd41445113bccaa037e5876659b4fd98d96af03e4 (patch)
tree10e4729909c6e19af0b3f33d04b89dd844d94868 /clang/lib/ExtractAPI/Serialization/SymbolGraphSerializer.cpp
parent2e44b7872bc638ed884ae4aa86e38b3b47e0b65a (diff)
downloadllvm-d41445113bccaa037e5876659b4fd98d96af03e4.zip
llvm-d41445113bccaa037e5876659b4fd98d96af03e4.tar.gz
llvm-d41445113bccaa037e5876659b4fd98d96af03e4.tar.bz2
[CUDA][HIP] Fix hostness check with -fopenmp
CUDA/HIP determines whether a function can be called based on the device/host attributes of callee and caller. Clang assumes the caller is CurContext. This is correct in most cases, however, it is not correct in OpenMP parallel region when CUDA/HIP program is compiled with -fopenmp. This causes incorrect overloading resolution and missed diagnostics. To get the correct caller, clang needs to chase the parent chain of DeclContext starting from CurContext until a function decl or a lambda decl is reached. Sema API is adapted to achieve that and used to determine the caller in hostness check. Reviewed by: Artem Belevich, Richard Smith Differential Revision: https://reviews.llvm.org/D121765
Diffstat (limited to 'clang/lib/ExtractAPI/Serialization/SymbolGraphSerializer.cpp')
0 files changed, 0 insertions, 0 deletions