33 #define OPTION(_1, _2, ID, _4, _5, _6, _7, _8, _9, _10, _11) OPT_##ID,
34 #include "Options.inc"
38 #define PREFIX(NAME, VALUE) const char *const NAME[] = VALUE;
39 #include "Options.inc"
43 #define OPTION(X1, X2, ID, KIND, GROUP, ALIAS, X6, X7, X8, X9, X10) \
45 X1, X2, X9, X10, OPT_##ID, llvm::opt::Option::KIND##Class, X8, X7, \
46 OPT_##GROUP, OPT_##ALIAS, X6 \
48 #include "Options.inc"
62 return Arg->getValue();
70 std::vector<StringRef>
Ret;
75 for (
auto *Arg : Args->
filtered(OPT_libpath))
76 Ret.push_back(Arg->getValue());
83 while (!Env.
empty()) {
85 std::tie(Path, Env) = Env.
split(
';');
93 for (
auto Dir : Paths) {
110 unsigned MissingIndex;
111 unsigned MissingCount;
113 Table.ParseArgs(ArgsArr.
slice(1), MissingIndex, MissingCount);
118 << (MissingCount == 1 ?
" argument.\n" :
" arguments.\n");
121 for (
auto *Arg : Args.
filtered(OPT_UNKNOWN))
122 llvm::errs() <<
"ignoring unknown argument: " << Arg->getSpelling() <<
"\n";
129 std::vector<StringRef> SearchPaths =
getSearchPaths(&Args, Saver);
131 std::vector<llvm::NewArchiveIterator> Members;
132 for (
auto *Arg : Args.
filtered(OPT_INPUT)) {
135 llvm::errs() << Arg->getValue() <<
": no such file or directory\n";
138 Members.emplace_back(Saver.
save(*Path),
142 std::pair<StringRef, std::error_code> Result =
148 if (Result.first.empty())
149 Result.first = ArgsArr[0];
150 llvm::errs() << Result.first <<
": " << Result.second.message() <<
"\n";
std::pair< StringRef, std::error_code > writeArchive(StringRef ArcName, std::vector< NewArchiveIterator > &NewMembers, bool WriteSymtab, object::Archive::Kind Kind, bool Deterministic)
raw_ostream & errs()
This returns a reference to a raw_ostream for standard error.
std::pair< StringRef, StringRef > split(char Separator) const
Split into two substrings around the first occurrence of a separator character.
void replace_extension(SmallVectorImpl< char > &path, const Twine &extension)
Replace the file extension of path with extension.
std::string str() const
str - Get the contents as an std::string.
bool ExpandResponseFiles(StringSaver &Saver, TokenizerCallback Tokenizer, SmallVectorImpl< const char * > &Argv, bool MarkEOLs=false)
Expand response files on a command line recursively using the given StringSaver and tokenization stra...
void append(SmallVectorImpl< char > &path, const Twine &a, const Twine &b="", const Twine &c="", const Twine &d="")
Append to path.
int libDriverMain(llvm::ArrayRef< const char * > ARgs)
ArrayRef< T > slice(unsigned N) const
slice(n) - Chop off the first N elements of the array.
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory)...
LLVM_CONSTEXPR size_t array_lengthof(T(&)[N])
Find the length of an array.
StringRef filename(StringRef path)
Get filename.
arg_iterator filtered_end() const
Allocate memory in an ever growing pool, as if by bump-pointer.
static Optional< std::string > findInputFile(StringRef File, ArrayRef< StringRef > Paths)
Provide access to the Option info table.
const char * save(const char *S)
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.
iterator_range< arg_iterator > filtered(OptSpecifier Id0=0U, OptSpecifier Id1=0U, OptSpecifier Id2=0U) const
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small...
static std::vector< StringRef > getSearchPaths(llvm::opt::InputArgList *Args, StringSaver &Saver)
StringRef str() const
Explicit conversion to StringRef.
Defines the llvm::Arg class for parsed arguments.
Saves strings in the inheritor's stable storage and returns a stable raw character pointer...
Provides a library for accessing information about this process and other processes on the operating ...
Entry for a single option instance in the option data table.
Arg * getLastArg(OptSpecifier Id) const
static std::string getOutputPath(llvm::opt::InputArgList *Args, const llvm::NewArchiveIterator &FirstMember)
arg_iterator filtered_begin(OptSpecifier Id0=0U, OptSpecifier Id1=0U, OptSpecifier Id2=0U) const
StringRef - Represent a constant reference to a string, i.e.
bool exists(file_status status)
Does file exist?
static Optional< std::string > GetEnv(StringRef name)
bool empty() const
empty - Check if the string is empty.