From 75656005dbc8866e1888932a68a830b0df403560 Mon Sep 17 00:00:00 2001 From: Kadir Cetinkaya Date: Fri, 29 Nov 2019 15:37:14 +0100 Subject: [llvm][Support] Take in CurrentDirectory as a parameter in ExpandResponseFiles Summary: This is a follow-up to D70769 and D70222, which allows propagation of current directory down to ExpandResponseFiles for handling of relative paths. Previously clients had to mutate FS to achieve that, which is not thread-safe and can even be thread-hostile in the case of real file system. Reviewers: sammccall Subscribers: hiraditya, cfe-commits, llvm-commits Tags: #clang, #llvm Differential Revision: https://reviews.llvm.org/D70857 --- clang/lib/Tooling/JSONCompilationDatabase.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'clang/lib/Tooling/JSONCompilationDatabase.cpp') diff --git a/clang/lib/Tooling/JSONCompilationDatabase.cpp b/clang/lib/Tooling/JSONCompilationDatabase.cpp index 8dd46083902..04dd4dbf624 100644 --- a/clang/lib/Tooling/JSONCompilationDatabase.cpp +++ b/clang/lib/Tooling/JSONCompilationDatabase.cpp @@ -29,6 +29,7 @@ #include "llvm/Support/MemoryBuffer.h" #include "llvm/Support/Path.h" #include "llvm/Support/StringSaver.h" +#include "llvm/Support/VirtualFileSystem.h" #include "llvm/Support/YAMLParser.h" #include "llvm/Support/raw_ostream.h" #include @@ -169,8 +170,7 @@ class JSONCompilationDatabasePlugin : public CompilationDatabasePlugin { JSONDatabasePath, ErrorMessage, JSONCommandLineSyntax::AutoDetect); return Base ? inferTargetAndDriverMode( inferMissingCompileCommands(expandResponseFiles( - std::move(Base), - llvm::vfs::createPhysicalFileSystem().release()))) + std::move(Base), llvm::vfs::getRealFileSystem()))) : nullptr; } }; -- cgit v1.2.3