diff options
| author | Kadir Cetinkaya <kadircet@google.com> | 2019-11-29 15:37:14 +0100 |
|---|---|---|
| committer | Kadir Cetinkaya <kadircet@google.com> | 2019-12-04 15:13:12 +0100 |
| commit | 75656005dbc8866e1888932a68a830b0df403560 (patch) | |
| tree | e8fab392d5c236a8c49e5ab1b6577d5f187db64f /llvm/include/llvm/Support/CommandLine.h | |
| parent | 45ef055d4ffda4d2b04b62f73e36cc6d5252758b (diff) | |
| download | bcm5719-llvm-75656005dbc8866e1888932a68a830b0df403560.tar.gz bcm5719-llvm-75656005dbc8866e1888932a68a830b0df403560.zip | |
[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
Diffstat (limited to 'llvm/include/llvm/Support/CommandLine.h')
| -rw-r--r-- | llvm/include/llvm/Support/CommandLine.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/llvm/include/llvm/Support/CommandLine.h b/llvm/include/llvm/Support/CommandLine.h index 5966febdf2b..6c0bb6c2fc3 100644 --- a/llvm/include/llvm/Support/CommandLine.h +++ b/llvm/include/llvm/Support/CommandLine.h @@ -20,6 +20,8 @@ #define LLVM_SUPPORT_COMMANDLINE_H #include "llvm/ADT/ArrayRef.h" +#include "llvm/ADT/None.h" +#include "llvm/ADT/Optional.h" #include "llvm/ADT/STLExtras.h" #include "llvm/ADT/SmallPtrSet.h" #include "llvm/ADT/SmallVector.h" @@ -1966,12 +1968,15 @@ bool readConfigFile(StringRef CfgFileName, StringSaver &Saver, /// \param [in] RelativeNames true if names of nested response files must be /// resolved relative to including file. /// \param [in] FS File system used for all file access when running the tool. +/// \param [in] CurrentDir Path used to resolve relative rsp files. If set to +/// None, process' cwd is used instead. /// \return true if all @files were expanded successfully or there were none. bool ExpandResponseFiles( StringSaver &Saver, TokenizerCallback Tokenizer, SmallVectorImpl<const char *> &Argv, bool MarkEOLs = false, bool RelativeNames = false, - llvm::vfs::FileSystem &FS = *llvm::vfs::getRealFileSystem()); + llvm::vfs::FileSystem &FS = *llvm::vfs::getRealFileSystem(), + llvm::Optional<llvm::StringRef> CurrentDir = llvm::None); /// Mark all options not part of this category as cl::ReallyHidden. /// |

