Merge pull request #68847 from rmaz/filecompdirpassthrough

Pass through file-compilation-dir to the ClangImporter.
This commit is contained in:
Richard Howell
2023-10-30 07:12:02 -07:00
committed by GitHub
2 changed files with 13 additions and 0 deletions

View File

@@ -1553,6 +1553,13 @@ static bool ParseClangImporterArgs(ClangImporterOptions &Opts, ArgList &Args,
Opts.ExtraArgs.push_back("-fdebug-prefix-map=" + Val);
}
if (auto *A = Args.getLastArg(OPT_file_compilation_dir)) {
// Forward the -file-compilation-dir flag to correctly set the
// debug compilation directory.
std::string Val(A->getValue());
Opts.ExtraArgs.push_back("-ffile-compilation-dir=" + Val);
}
if (FrontendOpts.CASFSRootIDs.empty() &&
FrontendOpts.ClangIncludeTrees.empty()) {
if (!workingDirectory.empty()) {