diff options
Diffstat (limited to 'clang/lib/Tooling/ExpandResponseFilesCompilationDatabase.cpp')
| -rw-r--r-- | clang/lib/Tooling/ExpandResponseFilesCompilationDatabase.cpp | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/clang/lib/Tooling/ExpandResponseFilesCompilationDatabase.cpp b/clang/lib/Tooling/ExpandResponseFilesCompilationDatabase.cpp index bb519277dfa..84936ba05b2 100644 --- a/clang/lib/Tooling/ExpandResponseFilesCompilationDatabase.cpp +++ b/clang/lib/Tooling/ExpandResponseFilesCompilationDatabase.cpp @@ -7,6 +7,7 @@ //===----------------------------------------------------------------------===// #include "clang/Tooling/CompilationDatabase.h" +#include "llvm/ADT/StringRef.h" #include "llvm/ADT/Triple.h" #include "llvm/Support/CommandLine.h" #include "llvm/Support/ConvertUTF.h" @@ -47,12 +48,6 @@ public: private: std::vector<CompileCommand> expand(std::vector<CompileCommand> Cmds) const { for (auto &Cmd : Cmds) { - // FIXME: we should rather propagate the current directory into - // ExpandResponseFiles as well in addition to FS. - if (std::error_code EC = FS->setCurrentWorkingDirectory(Cmd.Directory)) { - llvm::consumeError(llvm::errorCodeToError(EC)); - continue; - } bool SeenRSPFile = false; llvm::SmallVector<const char *, 20> Argv; Argv.reserve(Cmd.CommandLine.size()); @@ -64,7 +59,8 @@ private: continue; llvm::BumpPtrAllocator Alloc; llvm::StringSaver Saver(Alloc); - llvm::cl::ExpandResponseFiles(Saver, Tokenizer, Argv, false, false, *FS); + llvm::cl::ExpandResponseFiles(Saver, Tokenizer, Argv, false, false, *FS, + llvm::StringRef(Cmd.Directory)); Cmd.CommandLine.assign(Argv.begin(), Argv.end()); } return Cmds; |

