@@ -1352,7 +1352,12 @@ static StringRef getIdentStringFromSourceLocation(CodeGenFunction &CGF,
13521352 llvm::raw_svector_ostream OS(Buffer);
13531353 // Build debug location
13541354 PresumedLoc PLoc = CGF.getContext().getSourceManager().getPresumedLoc(Loc);
1355- OS << ";" << PLoc.getFilename() << ";";
1355+ OS << ";";
1356+ if (auto *DbgInfo = CGF.getDebugInfo())
1357+ OS << DbgInfo->remapDIPath(PLoc.getFilename());
1358+ else
1359+ OS << PLoc.getFilename();
1360+ OS << ";";
13561361 if (const auto *FD = dyn_cast_or_null<FunctionDecl>(CGF.CurFuncDecl))
13571362 OS << FD->getQualifiedNameAsString();
13581363 OS << ";" << PLoc.getLine() << ";" << PLoc.getColumn() << ";;";
@@ -1370,10 +1375,14 @@ llvm::Value *CGOpenMPRuntime::emitUpdateLocation(CodeGenFunction &CGF,
13701375 SrcLocStr = OMPBuilder.getOrCreateDefaultSrcLocStr(SrcLocStrSize);
13711376 } else {
13721377 std::string FunctionName;
1378+ std::string FileName;
13731379 if (const auto *FD = dyn_cast_or_null<FunctionDecl>(CGF.CurFuncDecl))
13741380 FunctionName = FD->getQualifiedNameAsString();
13751381 PresumedLoc PLoc = CGF.getContext().getSourceManager().getPresumedLoc(Loc);
1376- const char *FileName = PLoc.getFilename();
1382+ if (auto *DbgInfo = CGF.getDebugInfo())
1383+ FileName = DbgInfo->remapDIPath(PLoc.getFilename());
1384+ else
1385+ FileName = PLoc.getFilename();
13771386 unsigned Line = PLoc.getLine();
13781387 unsigned Column = PLoc.getColumn();
13791388 SrcLocStr = OMPBuilder.getOrCreateSrcLocStr(FunctionName, FileName, Line,
@@ -8840,10 +8849,14 @@ emitMappingInformation(CodeGenFunction &CGF, llvm::OpenMPIRBuilder &OMPBuilder,
88408849 ExprName = MapExprs.getMapDecl()->getNameAsString();
88418850 }
88428851
8852+ std::string FileName;
88438853 PresumedLoc PLoc = CGF.getContext().getSourceManager().getPresumedLoc(Loc);
8844- return OMPBuilder.getOrCreateSrcLocStr(PLoc.getFilename(), ExprName,
8845- PLoc.getLine(), PLoc.getColumn(),
8846- SrcLocStrSize);
8854+ if (auto *DbgInfo = CGF.getDebugInfo())
8855+ FileName = DbgInfo->remapDIPath(PLoc.getFilename());
8856+ else
8857+ FileName = PLoc.getFilename();
8858+ return OMPBuilder.getOrCreateSrcLocStr(FileName, ExprName, PLoc.getLine(),
8859+ PLoc.getColumn(), SrcLocStrSize);
88478860}
88488861/// Emit the arrays used to pass the captures and map information to the
88498862/// offloading runtime library. If there is no map or capture information,
0 commit comments