@@ -1352,7 +1352,12 @@ static StringRef getIdentStringFromSourceLocation(CodeGenFunction &CGF,
1352
1352
llvm::raw_svector_ostream OS(Buffer);
1353
1353
// Build debug location
1354
1354
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 << ";";
1356
1361
if (const auto *FD = dyn_cast_or_null<FunctionDecl>(CGF.CurFuncDecl))
1357
1362
OS << FD->getQualifiedNameAsString();
1358
1363
OS << ";" << PLoc.getLine() << ";" << PLoc.getColumn() << ";;";
@@ -1370,10 +1375,14 @@ llvm::Value *CGOpenMPRuntime::emitUpdateLocation(CodeGenFunction &CGF,
1370
1375
SrcLocStr = OMPBuilder.getOrCreateDefaultSrcLocStr(SrcLocStrSize);
1371
1376
} else {
1372
1377
std::string FunctionName;
1378
+ std::string FileName;
1373
1379
if (const auto *FD = dyn_cast_or_null<FunctionDecl>(CGF.CurFuncDecl))
1374
1380
FunctionName = FD->getQualifiedNameAsString();
1375
1381
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();
1377
1386
unsigned Line = PLoc.getLine();
1378
1387
unsigned Column = PLoc.getColumn();
1379
1388
SrcLocStr = OMPBuilder.getOrCreateSrcLocStr(FunctionName, FileName, Line,
@@ -8840,10 +8849,14 @@ emitMappingInformation(CodeGenFunction &CGF, llvm::OpenMPIRBuilder &OMPBuilder,
8840
8849
ExprName = MapExprs.getMapDecl()->getNameAsString();
8841
8850
}
8842
8851
8852
+ std::string FileName;
8843
8853
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);
8847
8860
}
8848
8861
/// Emit the arrays used to pass the captures and map information to the
8849
8862
/// offloading runtime library. If there is no map or capture information,
0 commit comments