forked from OSchip/llvm-project
Inline a trivial ctor.
Differential Revision: https://reviews.llvm.org/D43525 llvm-svn: 325948
This commit is contained in:
parent
ae87f86ec4
commit
39049c05a9
|
@ -34,14 +34,9 @@ using namespace llvm::wasm;
|
|||
using namespace lld;
|
||||
using namespace lld::wasm;
|
||||
|
||||
namespace {
|
||||
Configuration *lld::wasm::Config;
|
||||
|
||||
// Parses command line options.
|
||||
class WasmOptTable : public llvm::opt::OptTable {
|
||||
public:
|
||||
WasmOptTable();
|
||||
llvm::opt::InputArgList parse(ArrayRef<const char *> Argv);
|
||||
};
|
||||
namespace {
|
||||
|
||||
// Create enum with OPT_xxx values for each option in Options.td
|
||||
enum {
|
||||
|
@ -56,17 +51,14 @@ public:
|
|||
void link(ArrayRef<const char *> ArgsArr);
|
||||
|
||||
private:
|
||||
void createFiles(llvm::opt::InputArgList &Args);
|
||||
void createFiles(opt::InputArgList &Args);
|
||||
void addFile(StringRef Path);
|
||||
void addLibrary(StringRef Name);
|
||||
std::vector<InputFile *> Files;
|
||||
llvm::wasm::WasmGlobal StackPointerGlobal;
|
||||
};
|
||||
|
||||
} // anonymous namespace
|
||||
|
||||
Configuration *lld::wasm::Config;
|
||||
|
||||
bool lld::wasm::link(ArrayRef<const char *> Args, bool CanExitEarly,
|
||||
raw_ostream &Error) {
|
||||
errorHandler().LogName = Args[0];
|
||||
|
@ -91,8 +83,6 @@ bool lld::wasm::link(ArrayRef<const char *> Args, bool CanExitEarly,
|
|||
return !errorCount();
|
||||
}
|
||||
|
||||
// Create OptTable
|
||||
|
||||
// Create prefix string literals used in Options.td
|
||||
#define PREFIX(NAME, VALUE) const char *const NAME[] = VALUE;
|
||||
#include "Options.inc"
|
||||
|
@ -107,6 +97,12 @@ static const opt::OptTable::Info OptInfo[] = {
|
|||
#undef OPTION
|
||||
};
|
||||
|
||||
class WasmOptTable : public llvm::opt::OptTable {
|
||||
public:
|
||||
WasmOptTable() : OptTable(OptInfo) {}
|
||||
opt::InputArgList parse(ArrayRef<const char *> Argv);
|
||||
};
|
||||
|
||||
// Set color diagnostics according to -color-diagnostics={auto,always,never}
|
||||
// or -no-color-diagnostics flags.
|
||||
static void handleColorDiagnostics(opt::InputArgList &Args) {
|
||||
|
@ -143,8 +139,6 @@ static void printHelp(const char *Argv0) {
|
|||
WasmOptTable().PrintHelp(outs(), Argv0, "LLVM Linker", false);
|
||||
}
|
||||
|
||||
WasmOptTable::WasmOptTable() : OptTable(OptInfo) {}
|
||||
|
||||
opt::InputArgList WasmOptTable::parse(ArrayRef<const char *> Argv) {
|
||||
SmallVector<const char *, 256> Vec(Argv.data(), Argv.data() + Argv.size());
|
||||
|
||||
|
|
Loading…
Reference in New Issue