aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Tooling/JSONCompilationDatabase.cpp
diff options
context:
space:
mode:
authorShilei Tian <tianshilei1992@gmail.com>2020-10-26 22:32:18 -0400
committerShilei Tian <tianshilei1992@gmail.com>2020-10-26 22:33:22 -0400
commite20d64c3d9d81cad701f31d8481367222c76c787 (patch)
tree8511b9b27752f3bcc56d04b46f49235656464fbb /clang/lib/Tooling/JSONCompilationDatabase.cpp
parent00e573cadb2791804fd0859d0ee05b27b702e11e (diff)
downloadllvm-e20d64c3d9d81cad701f31d8481367222c76c787.zip
llvm-e20d64c3d9d81cad701f31d8481367222c76c787.tar.gz
llvm-e20d64c3d9d81cad701f31d8481367222c76c787.tar.bz2
[Clang][OpenMP] Fixed an issue of segment fault when using target nowait
The implementation of target nowait just wraps the target region into a task. The essential four parameters (base ptr, ptr, size, mapper) are taken as firstprivate such that they will be copied to the private location. When there is no user-defined mapper, the mapper variable will be nullptr. However, it will be still copied to the corresponding place. Therefore, a memcpy will be generated and the source pointer will be nullptr, causing a segmentation fault. The root cause is when calling `emitOffloadingArraysArgument`, the last argument `Options` has a field about whether it requires a task. It only takes depend clause into account. In this patch, the nowait clause is also included. There're two things that will be done in another patches: 1. target data nowait has not been supported yet. D90099 added the support. 2. When there is no mapper, the mapper array can be nullptr no matter whether it requires outer task or not. It can avoid an unnecessary data copy. This is an optimization that is covered in D90101. Reviewed By: jdoerfert Differential Revision: https://reviews.llvm.org/D89844
Diffstat (limited to 'clang/lib/Tooling/JSONCompilationDatabase.cpp')
0 files changed, 0 insertions, 0 deletions