LLVM 20.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.
 
Error readConfigFile (StringRef CfgFile, SmallVectorImpl< const char * > &Argv)
 Reads command line options from the given configuration file.
 
Error expandResponseFiles (SmallVectorImpl< const char * > &Argv)
 Expands constructs "@file" in the provided array of arguments recursively.
 

Detailed Description

Contains options that control response file expansion.

Definition at line 2146 of file CommandLine.h.

Constructor & Destructor Documentation

◆ ExpansionContext()

ExpansionContext::ExpansionContext ( BumpPtrAllocator A,
TokenizerCallback  T 
)

Definition at line 1386 of file CommandLine.cpp.

Member Function Documentation

◆ expandResponseFiles()

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

◆ 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 1389 of file CommandLine.cpp.

References llvm::sys::path::append(), llvm::SmallVectorImpl< T >::assign(), llvm::SmallString< InternalLen >::assign(), llvm::SmallVectorTemplateCommon< T, typename >::begin(), llvm::SmallVectorTemplateCommon< T, typename >::end(), 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 1426 of file CommandLine.cpp.

References llvm::SmallString< InternalLen >::assign(), expandResponseFiles(), 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 2190 of file CommandLine.h.

References X.

◆ setMarkEOLs()

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

Definition at line 2180 of file CommandLine.h.

References X.

◆ setRelativeNames()

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

Definition at line 2185 of file CommandLine.h.

References X.

◆ setSearchDirs()

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

Definition at line 2195 of file CommandLine.h.

References X.

◆ setVFS()

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

Definition at line 2200 of file CommandLine.h.

References X.


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