From ba7a92c01e86b5048a93abe7c26c25b90ea9040a Mon Sep 17 00:00:00 2001 From: Nico Weber Date: Wed, 21 Apr 2021 10:00:30 -0400 Subject: [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 --- llvm/lib/Support/CommandLine.cpp | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'llvm/lib/Support/CommandLine.cpp') 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 &Argv, bool MarkEOLs, - bool RelativeNames, llvm::vfs::FileSystem &FS, - llvm::Optional CurrentDir) { + bool RelativeNames, + llvm::Optional 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 &Argv, bool MarkEOLs, + bool RelativeNames, + llvm::Optional 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 &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, -- cgit v1.1