Skip to content

Commit a69ce06

Browse files
committed
[clang][OpenMP] Propoagate debug location to OMPIRBuilder reduction codegen
This patch propagates the debug location from Clang to the OpenMPIRBuilder. Fixes llvm#97428
1 parent 6b1c51b commit a69ce06

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

clang/lib/CodeGen/CGOpenMPRuntimeGPU.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1652,6 +1652,7 @@ static llvm::Value *castValueToType(CodeGenFunction &CGF, llvm::Value *Val,
16521652
/// Finally, a call is made to '__kmpc_nvptx_parallel_reduce_nowait_v2' to
16531653
/// reduce across workers and compute a globally reduced value.
16541654
///
1655+
16551656
void CGOpenMPRuntimeGPU::emitReduction(
16561657
CodeGenFunction &CGF, SourceLocation Loc, ArrayRef<const Expr *> Privates,
16571658
ArrayRef<const Expr *> LHSExprs, ArrayRef<const Expr *> RHSExprs,
@@ -1694,7 +1695,8 @@ void CGOpenMPRuntimeGPU::emitReduction(
16941695
CGF.AllocaInsertPt->getIterator());
16951696
InsertPointTy CodeGenIP(CGF.Builder.GetInsertBlock(),
16961697
CGF.Builder.GetInsertPoint());
1697-
llvm::OpenMPIRBuilder::LocationDescription OmpLoc(CodeGenIP);
1698+
llvm::OpenMPIRBuilder::LocationDescription OmpLoc(
1699+
CodeGenIP, CGF.SourceLocToDebugLoc(Loc));
16981700
llvm::SmallVector<llvm::OpenMPIRBuilder::ReductionInfo> ReductionInfos;
16991701

17001702
CodeGenFunction::OMPPrivateScope Scope(CGF);

0 commit comments

Comments
 (0)