@@ -620,7 +620,11 @@ static void addDebugCompDirArg(const ArgList &Args, ArgStringList &CmdArgs,
620
620
const llvm::vfs::FileSystem &VFS) {
621
621
if (Arg *A = Args.getLastArg (options::OPT_ffile_compilation_dir_EQ,
622
622
options::OPT_fdebug_compilation_dir_EQ)) {
623
- A->render (Args, CmdArgs);
623
+ if (A->getOption ().matches (options::OPT_ffile_compilation_dir_EQ))
624
+ CmdArgs.push_back (Args.MakeArgString (Twine (" -fdebug-compilation-dir=" ) +
625
+ A->getValue ()));
626
+ else
627
+ A->render (Args, CmdArgs);
624
628
} else if (llvm::ErrorOr<std::string> CWD =
625
629
VFS.getCurrentWorkingDirectory ()) {
626
630
CmdArgs.push_back (Args.MakeArgString (" -fdebug-compilation-dir=" + *CWD));
@@ -862,10 +866,14 @@ static void addPGOAndCoverageFlags(const ToolChain &TC, Compilation &C,
862
866
863
867
if (Arg *A = Args.getLastArg (options::OPT_ffile_compilation_dir_EQ,
864
868
options::OPT_fcoverage_compilation_dir_EQ)) {
865
- A->render (Args, CmdArgs);
869
+ if (A->getOption ().matches (options::OPT_ffile_compilation_dir_EQ))
870
+ CmdArgs.push_back (Args.MakeArgString (
871
+ Twine (" -fcoverage-compilation-dir=" ) + A->getValue ()));
872
+ else
873
+ A->render (Args, CmdArgs);
866
874
} else if (llvm::ErrorOr<std::string> CWD =
867
875
D.getVFS ().getCurrentWorkingDirectory ()) {
868
- Args.MakeArgString (" -fcoverage-compilation-dir=" + *CWD);
876
+ CmdArgs. push_back ( Args.MakeArgString (" -fcoverage-compilation-dir=" + *CWD) );
869
877
}
870
878
871
879
if (Args.hasArg (options::OPT_fprofile_exclude_files_EQ)) {
0 commit comments