34 #define OPTION(_1, _2, ID, _4, _5, _6, _7, _8, _9, _10, _11, _12) OPT_##ID, 35 #include "Options.inc" 39 #define PREFIX(NAME, VALUE) const char *const NAME[] = VALUE; 40 #include "Options.inc" 44 #define OPTION(X1, X2, ID, KIND, GROUP, ALIAS, X7, X8, X9, X10, X11, X12) \ 45 {X1, X2, X10, X11, OPT_##ID, opt::Option::KIND##Class, \ 46 X9, X8, OPT_##GROUP, OPT_##ALIAS, X7, X12}, 47 #include "Options.inc" 53 LibOptTable() : OptTable(InfoTable,
true) {}
61 return Arg->getValue();
69 std::vector<StringRef>
Ret;
75 Ret.push_back(
Arg->getValue());
82 while (!Env.
empty()) {
84 std::tie(Path, Env) = Env.
split(
';');
110 unsigned MissingIndex;
111 unsigned MissingCount;
113 Table.ParseArgs(ArgsArr.
slice(1), MissingIndex, MissingCount);
118 << (MissingCount == 1 ?
" argument.\n" :
" arguments.\n");
122 llvm::errs() <<
"ignoring unknown argument: " <<
Arg->getSpelling() <<
"\n";
125 if (Args.
hasArg(OPT_help)) {
126 Table.PrintHelp(
outs(),
"llvm-lib [options] file...",
"LLVM Lib");
134 std::vector<StringRef> SearchPaths =
getSearchPaths(&Args, Saver);
137 std::vector<NewArchiveMember> Members;
141 llvm::errs() <<
Arg->getValue() <<
": no such file or directory\n";
149 llvm::errs() <<
Arg->getValue() <<
": " << EIB.message() <<
"\n";
158 <<
": not a COFF object, bitcode or resource file\n";
161 Members.emplace_back(std::move(*MOrErr));
169 true, Args.
hasArg(OPT_llvmlibthin))) {
raw_ostream & errs()
This returns a reference to a raw_ostream for standard error.
LLVM_NODISCARD std::string str() const
str - Get the contents as an std::string.
This class represents lattice values for constants.
static std::string findInputFile(StringRef File, ArrayRef< StringRef > Paths)
Windows compiled resource file (.res)
virtual std::string message() const
Return the error message as a string.
iterator_range< filtered_iterator< sizeof...(OptSpecifiers)> > filtered(OptSpecifiers ...Ids) const
Error takeError()
Take ownership of the stored error.
Base class for error info classes.
Error writeArchive(StringRef ArcName, ArrayRef< NewArchiveMember > NewMembers, bool WriteSymtab, object::Archive::Kind Kind, bool Deterministic, bool Thin, std::unique_ptr< MemoryBuffer > OldArchiveBuf=nullptr)
void append(SmallVectorImpl< char > &path, const Twine &a, const Twine &b="", const Twine &c="", const Twine &d="")
Append to path.
file_magic identify_magic(StringRef magic)
Identify the type of a binary file based on how magical it is.
Tagged union holding either a T or a Error.
void TokenizeWindowsCommandLine(StringRef Source, StringSaver &Saver, SmallVectorImpl< const char *> &NewArgv, bool MarkEOLs=false)
Tokenizes a Windows command line which may contain quotes and escaped quotes.
StringRef str() const
Explicit conversion to StringRef.
static std::vector< StringRef > getSearchPaths(opt::InputArgList *Args, StringSaver &Saver)
bool hasArg(OptSpecifiers ...Ids) const
LLVM_NODISCARD LLVM_ATTRIBUTE_ALWAYS_INLINE bool empty() const
empty - Check if the string is empty.
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory)...
raw_ostream & outs()
This returns a reference to a raw_ostream for standard output.
bool hasArgNoClaim(OptSpecifiers ...Ids) const
hasArg - Does the arg list contain any option matching Id.
Allocate memory in an ever growing pool, as if by bump-pointer.
Provide access to the Option info table.
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
int libDriverMain(ArrayRef< const char *> ARgs)
Arg * getLastArg(OptSpecifiers ...Ids) const
Return the last argument matching Id, or null.
static const char *const Magic
void handleAllErrors(Error E, HandlerTs &&... Handlers)
Behaves the same as handleErrors, except that by contract all errors must be handled by the given han...
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small...
void replace_extension(SmallVectorImpl< char > &path, const Twine &extension, Style style=Style::native)
Replace the file extension of path with extension.
LLVM_NODISCARD std::pair< StringRef, StringRef > split(char Separator) const
Split into two substrings around the first occurrence of a separator character.
StringRef save(const char *S)
Defines the llvm::Arg class for parsed arguments.
ArrayRef< T > slice(size_t N, size_t M) const
slice(n, m) - Chop off the first N elements of the array, and keep M elements in the array...
amdgpu Simplify well known AMD library false Value Value * Arg
Saves strings in the provided stable storage and returns a StringRef with a stable character pointer...
Provides a library for accessing information about this process and other processes on the operating ...
static std::string getOutputPath(opt::InputArgList *Args, const NewArchiveMember &FirstMember)
Entry for a single option instance in the option data table.
static Expected< NewArchiveMember > getFile(StringRef FileName, bool Deterministic)
Lightweight error class with error context and mandatory checking.
bool ExpandResponseFiles(StringSaver &Saver, TokenizerCallback Tokenizer, SmallVectorImpl< const char *> &Argv, bool MarkEOLs=false, bool RelativeNames=false)
Expand response files on a command line recursively using the given StringSaver and tokenization stra...
StringRef - Represent a constant reference to a string, i.e.
std::unique_ptr< MemoryBuffer > Buf
bool exists(const basic_file_status &status)
Does file exist?
static Optional< std::string > GetEnv(StringRef name)
constexpr char Args[]
Key for Kernel::Metadata::mArgs.
file_magic - An "enum class" enumeration of file types based on magic (the first N bytes of the file)...