Add a -debug-module-path frontend option

This new option allows the Driver to pass the path to a compilation
job's own binary swiftmodule artifact to the frontend. The compiler
then stores this path in the debug info, to allow clients like LLDB to
unambiguously know which binary Swift module belongs to which compile
unit.

rdar://163302154
This commit is contained in:
Adrian Prantl
2025-10-23 16:56:59 -07:00
parent be3009dd33
commit cb4efa0839
5 changed files with 23 additions and 3 deletions

View File

@@ -3460,6 +3460,9 @@ static bool ParseIRGenArgs(IRGenOptions &Opts, ArgList &Args,
A->getAsString(Args), A->getValue());
}
if (const Arg *A = Args.getLastArg(options::OPT_debug_module_path))
Opts.DebugModulePath = A->getValue();
for (auto A : Args.getAllArgValues(options::OPT_file_prefix_map)) {
auto SplitMap = StringRef(A).split('=');
Opts.FilePrefixMap.addMapping(SplitMap.first, SplitMap.second);