@@ -637,22 +637,25 @@ class IRGenDebugInfoImpl : public IRGenDebugInfo {
637
637
if (Val != DIModuleCache.end ())
638
638
return cast<llvm::DIModule>(Val->second );
639
639
640
+ std::string RemappedIncludePath = DebugPrefixMap.remapPath (IncludePath);
641
+
640
642
// For Clang modules / PCH, create a Skeleton CU pointing to the PCM/PCH.
641
643
bool CreateSkeletonCU = !ASTFile.empty ();
642
644
bool IsRootModule = !Parent;
643
645
if (CreateSkeletonCU && IsRootModule) {
644
646
llvm::DIBuilder DIB (M);
645
647
DIB.createCompileUnit (IGM.ObjCInterop ? llvm::dwarf::DW_LANG_ObjC
646
648
: llvm::dwarf::DW_LANG_C99,
647
- DIB.createFile (Name, IncludePath ),
649
+ DIB.createFile (Name, RemappedIncludePath ),
648
650
TheCU->getProducer (), true , StringRef (), 0 , ASTFile,
649
651
llvm::DICompileUnit::FullDebug, Signature);
650
652
DIB.finalize ();
651
653
}
652
654
653
655
StringRef Sysroot = IGM.Context .SearchPathOpts .SDKPath ;
654
656
llvm::DIModule *M =
655
- DBuilder.createModule (Parent, Name, ConfigMacros, IncludePath, Sysroot);
657
+ DBuilder.createModule (Parent, Name, ConfigMacros, RemappedIncludePath,
658
+ Sysroot);
656
659
DIModuleCache.insert ({Key, llvm::TrackingMDNodeRef (M)});
657
660
return M;
658
661
}
0 commit comments