Skip to content

Commit 39049c0

Browse files
committedFeb 23, 2018
Inline a trivial ctor.
Differential Revision: https://reviews.llvm.org/D43525 llvm-svn: 325948
1 parent ae87f86 commit 39049c0

File tree

1 file changed

+9
-15
lines changed

1 file changed

+9
-15
lines changed
 

‎lld/wasm/Driver.cpp

+9-15
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,9 @@ using namespace llvm::wasm;
3434
using namespace lld;
3535
using namespace lld::wasm;
3636

37-
namespace {
37+
Configuration *lld::wasm::Config;
3838

39-
// Parses command line options.
40-
class WasmOptTable : public llvm::opt::OptTable {
41-
public:
42-
WasmOptTable();
43-
llvm::opt::InputArgList parse(ArrayRef<const char *> Argv);
44-
};
39+
namespace {
4540

4641
// Create enum with OPT_xxx values for each option in Options.td
4742
enum {
@@ -56,17 +51,14 @@ class LinkerDriver {
5651
void link(ArrayRef<const char *> ArgsArr);
5752

5853
private:
59-
void createFiles(llvm::opt::InputArgList &Args);
54+
void createFiles(opt::InputArgList &Args);
6055
void addFile(StringRef Path);
6156
void addLibrary(StringRef Name);
6257
std::vector<InputFile *> Files;
6358
llvm::wasm::WasmGlobal StackPointerGlobal;
6459
};
65-
6660
} // anonymous namespace
6761

68-
Configuration *lld::wasm::Config;
69-
7062
bool lld::wasm::link(ArrayRef<const char *> Args, bool CanExitEarly,
7163
raw_ostream &Error) {
7264
errorHandler().LogName = Args[0];
@@ -91,8 +83,6 @@ bool lld::wasm::link(ArrayRef<const char *> Args, bool CanExitEarly,
9183
return !errorCount();
9284
}
9385

94-
// Create OptTable
95-
9686
// Create prefix string literals used in Options.td
9787
#define PREFIX(NAME, VALUE) const char *const NAME[] = VALUE;
9888
#include "Options.inc"
@@ -107,6 +97,12 @@ static const opt::OptTable::Info OptInfo[] = {
10797
#undef OPTION
10898
};
10999

100+
class WasmOptTable : public llvm::opt::OptTable {
101+
public:
102+
WasmOptTable() : OptTable(OptInfo) {}
103+
opt::InputArgList parse(ArrayRef<const char *> Argv);
104+
};
105+
110106
// Set color diagnostics according to -color-diagnostics={auto,always,never}
111107
// or -no-color-diagnostics flags.
112108
static void handleColorDiagnostics(opt::InputArgList &Args) {
@@ -143,8 +139,6 @@ static void printHelp(const char *Argv0) {
143139
WasmOptTable().PrintHelp(outs(), Argv0, "LLVM Linker", false);
144140
}
145141

146-
WasmOptTable::WasmOptTable() : OptTable(OptInfo) {}
147-
148142
opt::InputArgList WasmOptTable::parse(ArrayRef<const char *> Argv) {
149143
SmallVector<const char *, 256> Vec(Argv.data(), Argv.data() + Argv.size());
150144

0 commit comments

Comments
 (0)
Please sign in to comment.