33 #define OPTION(_1, _2, ID, _4, _5, _6, _7, _8, _9, _10, _11, _12) 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, X7, X8, X9, X10, X11, X12) \ 44 {X1, X2, X10, X11, OPT_##ID, llvm::opt::Option::KIND##Class, \ 45 X9, X8, OPT_##GROUP, OPT_##ALIAS, X7, X12}, 46 #include "Options.inc" 52 DllOptTable() : OptTable(InfoTable,
false) {}
61 if (std::error_code EC = MB.
getError()) {
62 llvm::errs() <<
"cannot open file " << Path <<
": " << EC.message() <<
"\n";
66 return std::move(*MB);
87 unsigned MissingIndex;
88 unsigned MissingCount;
90 Table.ParseArgs(ArgsArr.
slice(1), MissingIndex, MissingCount);
99 Table.PrintHelp(
outs(),
"llvm-dlltool [options] file...",
"llvm-dlltool",
101 llvm::outs() <<
"\nTARGETS: i386, i386:x86-64, arm, arm64\n";
106 llvm::errs() <<
"error: no target machine specified\n" 107 <<
"supported targets: i386, i386:x86-64, arm, arm64\n";
112 llvm::errs() <<
"ignoring unknown argument: " <<
Arg->getSpelling() <<
"\n";
114 if (!Args.
hasArg(OPT_d)) {
115 llvm::errs() <<
"no definition file specified\n";
119 std::unique_ptr<MemoryBuffer> MB =
124 if (!MB->getBufferSize()) {
149 Def->OutputFile =
Arg->getValue();
151 if (Def->OutputFile.empty()) {
Represents either an error or a value T.
raw_ostream & errs()
This returns a reference to a raw_ostream for standard error.
This class represents lattice values for constants.
iterator_range< filtered_iterator< sizeof...(OptSpecifiers)> > filtered(OptSpecifiers ...Ids) const
Error takeError()
Take ownership of the stored error.
Expected< COFFModuleDefinition > parseCOFFModuleDefinition(MemoryBufferRef MB, COFF::MachineTypes Machine, bool MingwDef=false)
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
int dlltoolDriverMain(ArrayRef< const char *> ArgsArr)
Tagged union holding either a T or a Error.
LLVM_NODISCARD LLVM_ATTRIBUTE_ALWAYS_INLINE R Default(T Value)
StringRef str() const
Explicit conversion to StringRef.
Error writeImportLibrary(StringRef ImportName, StringRef Path, ArrayRef< COFFShortExport > Exports, COFF::MachineTypes Machine, bool MinGW)
bool hasArg(OptSpecifiers ...Ids) const
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory)...
COFF::MachineTypes Machine
void append(in_iter S, in_iter E)
Append from an iterator pair.
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.
A switch()-like statement whose cases are string literals.
Provide access to the Option info table.
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
std::error_code getError() const
Arg * getLastArg(OptSpecifiers ...Ids) const
Return the last argument matching Id, or null.
void replace_extension(SmallVectorImpl< char > &path, const Twine &extension, Style style=Style::native)
Replace the file extension of path with extension.
Defines the llvm::Arg class for parsed arguments.
LLVM_ATTRIBUTE_ALWAYS_INLINE StringSwitch & Case(StringLiteral S, T Value)
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...
StringRef getLastArgValue(OptSpecifier Id, StringRef Default="") const
getLastArgValue - Return the value of the last argument, or a default.
amdgpu Simplify well known AMD library false Value Value * Arg
Entry for a single option instance in the option data table.
static ErrorOr< std::unique_ptr< MemoryBuffer > > getFile(const Twine &Filename, int64_t FileSize=-1, bool RequiresNullTerminator=true, bool IsVolatile=false)
Open the specified file as a MemoryBuffer, returning a new MemoryBuffer if successful, otherwise returning null.
StringRef - Represent a constant reference to a string, i.e.
const char * getValue(unsigned N=0) const
std::error_code errorToErrorCode(Error Err)
Helper for converting an ECError to a std::error_code.
constexpr char Args[]
Key for Kernel::Metadata::mArgs.