LLVM  16.0.0git
Public Member Functions | List of all members
llvm::cl::ExpansionContext Class Reference

Contains options that control response file expansion. More...

#include "llvm/Support/CommandLine.h"

Public Member Functions

 ExpansionContext (BumpPtrAllocator &A, TokenizerCallback T)
 
ExpansionContextsetMarkEOLs (bool X)
 
ExpansionContextsetRelativeNames (bool X)
 
ExpansionContextsetCurrentDir (StringRef X)
 
ExpansionContextsetSearchDirs (ArrayRef< StringRef > X)
 
ExpansionContextsetVFS (vfs::FileSystem *X)
 
bool findConfigFile (StringRef FileName, SmallVectorImpl< char > &FilePath)
 Looks for the specified configuration file. More...
 
Error readConfigFile (StringRef CfgFile, SmallVectorImpl< const char * > &Argv)
 Reads command line options from the given configuration file. More...
 
Error expandResponseFiles (SmallVectorImpl< const char * > &Argv)
 Expands constructs "@file" in the provided array of arguments recursively. More...
 

Detailed Description

Contains options that control response file expansion.

Definition at line 2129 of file CommandLine.h.

Constructor & Destructor Documentation

◆ ExpansionContext()

ExpansionContext::ExpansionContext ( BumpPtrAllocator A,
TokenizerCallback  T 
)

Definition at line 1389 of file CommandLine.cpp.

References T.

Member Function Documentation

◆ expandResponseFiles()

Error ExpansionContext::expandResponseFiles ( SmallVectorImpl< const char * > &  Argv)

Expands constructs "@file" in the provided array of arguments recursively.

Expand response files on a command line recursively using the given StringSaver and tokenization strategy.

Definition at line 1239 of file CommandLine.cpp.

◆ findConfigFile()

bool ExpansionContext::findConfigFile ( StringRef  FileName,
SmallVectorImpl< char > &  FilePath 
)

Looks for the specified configuration file.

Parameters
[in]FileNameName of the file to search for.
[out]FilePathFile absolute path, if it was found.
Returns
True if file was found.

If the specified file name contains a directory separator, it is searched for by its absolute path. Otherwise looks for file sequentially in directories specified by SearchDirs field.

Definition at line 1392 of file CommandLine.cpp.

References llvm::sys::path::append(), llvm::SmallString< InternalLen >::assign(), llvm::SmallVectorImpl< T >::assign(), llvm::sys::path::has_parent_path(), llvm::sys::path::is_relative(), llvm::vfs::FileSystem::makeAbsolute(), llvm::sys::path::native(), llvm::sys::fs::regular_file, and llvm::vfs::FileSystem::status().

◆ readConfigFile()

Error ExpansionContext::readConfigFile ( StringRef  CfgFile,
SmallVectorImpl< const char * > &  Argv 
)

Reads command line options from the given configuration file.

Parameters
[in]CfgFilePath to configuration file.
[out]ArgvArray to which the read options are added.
Returns
true if the file was successfully read.

It reads content of the specified file, tokenizes it and expands "@file" commands resolving file names in them relative to the directory where CfgFilename resides. It also expands "<CFGDIR>" to the base path of the current config file.

Definition at line 1429 of file CommandLine.cpp.

References llvm::SmallString< InternalLen >::assign(), llvm::sys::path::is_relative(), llvm::vfs::FileSystem::makeAbsolute(), and llvm::SmallString< InternalLen >::str().

◆ setCurrentDir()

ExpansionContext& llvm::cl::ExpansionContext::setCurrentDir ( StringRef  X)
inline

Definition at line 2173 of file CommandLine.h.

References X.

◆ setMarkEOLs()

ExpansionContext& llvm::cl::ExpansionContext::setMarkEOLs ( bool  X)
inline

Definition at line 2163 of file CommandLine.h.

References X.

◆ setRelativeNames()

ExpansionContext& llvm::cl::ExpansionContext::setRelativeNames ( bool  X)
inline

Definition at line 2168 of file CommandLine.h.

References X.

◆ setSearchDirs()

ExpansionContext& llvm::cl::ExpansionContext::setSearchDirs ( ArrayRef< StringRef X)
inline

Definition at line 2178 of file CommandLine.h.

References X.

◆ setVFS()

ExpansionContext& llvm::cl::ExpansionContext::setVFS ( vfs::FileSystem X)
inline

Definition at line 2183 of file CommandLine.h.

References X.


The documentation for this class was generated from the following files: