diff options
author | Nico Weber <thakis@chromium.org> | 2021-04-21 10:00:30 -0400 |
---|---|---|
committer | Nico Weber <thakis@chromium.org> | 2021-04-21 10:19:01 -0400 |
commit | ba7a92c01e86b5048a93abe7c26c25b90ea9040a (patch) | |
tree | 4628efebcf9adf2bc38da4cb55b1db33cb986cbf /llvm/lib/Support/CommandLine.cpp | |
parent | 2f69975683f5b6ea7df79f335f96b889a4bddecd (diff) | |
download | llvm-ba7a92c01e86b5048a93abe7c26c25b90ea9040a.zip llvm-ba7a92c01e86b5048a93abe7c26c25b90ea9040a.tar.gz llvm-ba7a92c01e86b5048a93abe7c26c25b90ea9040a.tar.bz2 |
[Support] Don't include VirtualFileSystem.h in CommandLine.h
CommandLine.h is indirectly included in ~50% of TUs when building
clang, and VirtualFileSystem.h is large.
(Already remarked by jhenderson on D70769.)
No behavior change.
Differential Revision: https://reviews.llvm.org/D100957
Diffstat (limited to 'llvm/lib/Support/CommandLine.cpp')
-rw-r--r-- | llvm/lib/Support/CommandLine.cpp | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/llvm/lib/Support/CommandLine.cpp b/llvm/lib/Support/CommandLine.cpp index 93d4651..cdd8ec2 100644 --- a/llvm/lib/Support/CommandLine.cpp +++ b/llvm/lib/Support/CommandLine.cpp @@ -1138,8 +1138,9 @@ static llvm::Error ExpandResponseFile( /// StringSaver and tokenization strategy. bool cl::ExpandResponseFiles(StringSaver &Saver, TokenizerCallback Tokenizer, SmallVectorImpl<const char *> &Argv, bool MarkEOLs, - bool RelativeNames, llvm::vfs::FileSystem &FS, - llvm::Optional<llvm::StringRef> CurrentDir) { + bool RelativeNames, + llvm::Optional<llvm::StringRef> CurrentDir, + llvm::vfs::FileSystem &FS) { bool AllExpanded = true; struct ResponseFileRecord { std::string File; @@ -1247,6 +1248,15 @@ bool cl::ExpandResponseFiles(StringSaver &Saver, TokenizerCallback Tokenizer, return AllExpanded; } +bool cl::ExpandResponseFiles(StringSaver &Saver, TokenizerCallback Tokenizer, + SmallVectorImpl<const char *> &Argv, bool MarkEOLs, + bool RelativeNames, + llvm::Optional<StringRef> CurrentDir) { + return ExpandResponseFiles(Saver, std::move(Tokenizer), Argv, MarkEOLs, + RelativeNames, std::move(CurrentDir), + *vfs::getRealFileSystem()); +} + bool cl::expandResponseFiles(int Argc, const char *const *Argv, const char *EnvVar, StringSaver &Saver, SmallVectorImpl<const char *> &NewArgv) { @@ -1273,14 +1283,14 @@ bool cl::readConfigFile(StringRef CfgFile, StringSaver &Saver, } if (llvm::Error Err = ExpandResponseFile(CfgFile, Saver, cl::tokenizeConfigFile, Argv, - /*MarkEOLs*/ false, /*RelativeNames*/ true, + /*MarkEOLs=*/false, /*RelativeNames=*/true, *llvm::vfs::getRealFileSystem())) { // TODO: The error should be propagated up the stack. llvm::consumeError(std::move(Err)); return false; } return ExpandResponseFiles(Saver, cl::tokenizeConfigFile, Argv, - /*MarkEOLs*/ false, /*RelativeNames*/ true); + /*MarkEOLs=*/false, /*RelativeNames=*/true); } bool cl::ParseCommandLineOptions(int argc, const char *const *argv, |