28 using namespace llvm::object;
29 using namespace llvm::COFF;
35 #define OPTION(_1, _2, ID, _4, _5, _6, _7, _8, _9, _10, _11, _12) OPT_##ID,
36 #include "Options.inc"
40 #define PREFIX(NAME, VALUE) const char *const NAME[] = VALUE;
41 #include "Options.inc"
45 #define OPTION(X1, X2, ID, KIND, GROUP, ALIAS, X7, X8, X9, X10, X11, X12) \
46 {X1, X2, X10, X11, OPT_##ID, llvm::opt::Option::KIND##Class, \
47 X9, X8, OPT_##GROUP, OPT_##ALIAS, X7, X12},
48 #include "Options.inc"
54 DllOptTable() : OptTable(infoTable,
false) {}
59 std::vector<std::unique_ptr<MemoryBuffer>>
OwningMBs;
66 if (std::error_code EC = MB.
getError()) {
67 llvm::errs() <<
"fail openFile: " << EC.message() <<
"\n";
93 unsigned MissingIndex;
94 unsigned MissingCount;
96 Table.ParseArgs(ArgsArr.
slice(1), MissingIndex, MissingCount);
105 Table.PrintHelp(
outs(), ArgsArr[0],
"dlltool",
false);
106 llvm::outs() <<
"\nTARGETS: i386, i386:x86-64, arm\n";
111 llvm::errs() <<
"error: no target machine specified\n"
112 <<
"supported targets: i386, i386:x86-64, arm\n";
116 for (
auto *Arg : Args.
filtered(OPT_UNKNOWN))
117 llvm::errs() <<
"ignoring unknown argument: " << Arg->getSpelling() <<
"\n";
119 if (!Args.
hasArg(OPT_d)) {
120 llvm::errs() <<
"no definition file specified\n";
153 Def->OutputFile = Arg->getValue();
155 if (Def->OutputFile.empty()) {
std::error_code getError() const
Represents either an error or a value T.
raw_ostream & errs()
This returns a reference to a raw_ostream for standard error.
Error takeError()
Take ownership of the stored error.
const char * getValue(unsigned N=0) const
Expected< COFFModuleDefinition > parseCOFFModuleDefinition(MemoryBufferRef MB, COFF::MachineTypes Machine, bool MingwDef=false)
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...
LLVM_ATTRIBUTE_ALWAYS_INLINE R Default(const T &Value) const
Tagged union holding either a T or a Error.
LLVM_ATTRIBUTE_ALWAYS_INLINE StringSwitch & Case(const char(&S)[N], const T &Value)
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory)...
int dlltoolDriverMain(ArrayRef< const char * > ArgsArr)
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.
Function Alias Analysis false
A switch()-like statement whose cases are string literals.
Provide access to the Option info table.
constexpr char Args[]
Key for Kernel::Metadata::mArgs.
iterator_range< filtered_iterator< sizeof...(OptSpecifiers)> > filtered(OptSpecifiers...Ids) const
size_t getBufferSize() const
std::error_code writeImportLibrary(StringRef ImportName, StringRef Path, ArrayRef< COFFShortExport > Exports, COFF::MachineTypes Machine, bool MakeWeakAliases)
void replace_extension(SmallVectorImpl< char > &path, const Twine &extension, Style style=Style::native)
Replace the file extension of path with extension.
bool hasArgNoClaim(OptSpecifiers...Ids) const
hasArg - Does the arg list contain any option matching Id.
Arg * getLastArg(OptSpecifiers...Ids) const
Return the last argument matching Id, or null.
StringRef str() const
Explicit conversion to StringRef.
Defines the llvm::Arg class for parsed arguments.
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.
StringRef getLastArgValue(OptSpecifier Id, StringRef Default="") const
getLastArgValue - Return the value of the last argument, or a default.
bool hasArg(OptSpecifiers...Ids) const
std::error_code errorToErrorCode(Error Err)
Helper for converting an ECError to a std::error_code.