blob: df51921396abce6a9d343d4cdb8d7083d920ba1d [file] [log] [blame]
Teresa Johnson9ba95f92016-08-11 14:58:12 +00001//===-- llvm-lto2: test harness for the resolution-based LTO interface ----===//
2//
Chandler Carruth2946cd72019-01-19 08:50:56 +00003// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
Teresa Johnson9ba95f92016-08-11 14:58:12 +00006//
7//===----------------------------------------------------------------------===//
8//
9// This program takes in a list of bitcode files, links them and performs
10// link-time optimization according to the provided symbol resolutions using the
11// resolution-based LTO interface, and outputs one or more object files.
12//
13// This program is intended to eventually replace llvm-lto which uses the legacy
14// LTO interface.
15//
16//===----------------------------------------------------------------------===//
17
Peter Collingbourne99b98c22017-06-27 23:50:24 +000018#include "llvm/Bitcode/BitcodeReader.h"
David Blaikie4333f972018-04-11 18:49:37 +000019#include "llvm/CodeGen/CommandFlags.inc"
Mehdi Amini14f19bd2016-12-23 23:54:17 +000020#include "llvm/IR/DiagnosticPrinter.h"
Peter Collingbourne99b98c22017-06-27 23:50:24 +000021#include "llvm/LTO/Caching.h"
Teresa Johnson9ba95f92016-08-11 14:58:12 +000022#include "llvm/LTO/LTO.h"
23#include "llvm/Support/CommandLine.h"
Peter Collingbourne192d8522017-03-28 23:35:34 +000024#include "llvm/Support/FileSystem.h"
Teresa Johnson0bc6b7b2018-10-16 17:37:45 +000025#include "llvm/Support/InitLLVM.h"
Teresa Johnson9ba95f92016-08-11 14:58:12 +000026#include "llvm/Support/TargetSelect.h"
Teresa Johnsonec544c52016-10-19 17:35:01 +000027#include "llvm/Support/Threading.h"
Teresa Johnson9ba95f92016-08-11 14:58:12 +000028
29using namespace llvm;
30using namespace lto;
Teresa Johnson9ba95f92016-08-11 14:58:12 +000031
Teresa Johnson002af9b2016-10-31 22:12:21 +000032static cl::opt<char>
33 OptLevel("O", cl::desc("Optimization level. [-O0, -O1, -O2, or -O3] "
34 "(default = '-O2')"),
35 cl::Prefix, cl::ZeroOrMore, cl::init('2'));
36
Peter Collingbournef4257522016-12-08 05:28:30 +000037static cl::opt<char> CGOptLevel(
38 "cg-opt-level",
39 cl::desc("Codegen optimization level (0, 1, 2 or 3, default = '2')"),
40 cl::init('2'));
41
Teresa Johnson9ba95f92016-08-11 14:58:12 +000042static cl::list<std::string> InputFilenames(cl::Positional, cl::OneOrMore,
43 cl::desc("<input bitcode files>"));
44
45static cl::opt<std::string> OutputFilename("o", cl::Required,
46 cl::desc("Output filename"),
47 cl::value_desc("filename"));
48
Mehdi Aminiadc0e262016-08-23 21:30:12 +000049static cl::opt<std::string> CacheDir("cache-dir", cl::desc("Cache Directory"),
50 cl::value_desc("directory"));
51
Davide Italianoec9612d2016-09-07 17:46:16 +000052static cl::opt<std::string> OptPipeline("opt-pipeline",
53 cl::desc("Optimizer Pipeline"),
54 cl::value_desc("pipeline"));
55
Davide Italiano14e9e8a2016-09-16 21:03:21 +000056static cl::opt<std::string> AAPipeline("aa-pipeline",
57 cl::desc("Alias Analysis Pipeline"),
58 cl::value_desc("aapipeline"));
59
Teresa Johnson9ba95f92016-08-11 14:58:12 +000060static cl::opt<bool> SaveTemps("save-temps", cl::desc("Save temporary files"));
61
Mehdi Amini458f8052016-08-19 23:54:40 +000062static cl::opt<bool>
63 ThinLTODistributedIndexes("thinlto-distributed-indexes", cl::init(false),
64 cl::desc("Write out individual index and "
65 "import files for the "
66 "distributed backend case"));
67
Mehdi Amini95c1f912016-12-23 23:54:34 +000068static cl::opt<int> Threads("thinlto-threads",
Teresa Johnsonec544c52016-10-19 17:35:01 +000069 cl::init(llvm::heavyweight_hardware_concurrency()));
Mehdi Amini458f8052016-08-19 23:54:40 +000070
Teresa Johnson9ba95f92016-08-11 14:58:12 +000071static cl::list<std::string> SymbolResolutions(
72 "r",
73 cl::desc("Specify a symbol resolution: filename,symbolname,resolution\n"
74 "where \"resolution\" is a sequence (which may be empty) of the\n"
75 "following characters:\n"
76 " p - prevailing: the linker has chosen this definition of the\n"
77 " symbol\n"
78 " l - local: the definition of this symbol is unpreemptable at\n"
79 " runtime and is known to be in this linkage unit\n"
80 " x - externally visible: the definition of this symbol is\n"
81 " visible outside of the LTO unit\n"
82 "A resolution for each symbol must be specified."),
83 cl::ZeroOrMore);
84
Peter Collingbournef4257522016-12-08 05:28:30 +000085static cl::opt<std::string> OverrideTriple(
86 "override-triple",
87 cl::desc("Replace target triples in input files with this triple"));
88
89static cl::opt<std::string> DefaultTriple(
90 "default-triple",
91 cl::desc(
92 "Replace unspecified target triples in input files with this triple"));
93
Davide Italianoebd47192017-02-12 03:31:30 +000094static cl::opt<std::string>
95 OptRemarksOutput("pass-remarks-output",
96 cl::desc("YAML output file for optimization remarks"));
97
Davide Italianocd6d7b12017-02-13 16:08:36 +000098static cl::opt<bool> OptRemarksWithHotness(
Davide Italiano6cb6f992017-02-12 05:05:35 +000099 "pass-remarks-with-hotness",
100 cl::desc("Whether to include hotness informations in the remarks.\n"
101 "Has effect only if -pass-remarks-output is specified."));
102
Tobias Edler von Koch819d8402017-07-28 23:43:22 +0000103static cl::opt<std::string>
Francis Visoiu Mistrihdd422362019-03-12 21:22:27 +0000104 OptRemarksPasses("pass-remarks-filter",
105 cl::desc("Only record optimization remarks from passes "
106 "whose names match the given regular expression"),
107 cl::value_desc("regex"));
108
109static cl::opt<std::string>
Tobias Edler von Koch819d8402017-07-28 23:43:22 +0000110 SamplePGOFile("lto-sample-profile-file",
111 cl::desc("Specify a SamplePGO profile file"));
112
Rong Xu6cdf3d82019-02-27 17:24:33 +0000113static cl::opt<std::string>
114 CSPGOFile("lto-cspgo-profile-file",
115 cl::desc("Specify a context sensitive PGO profile file"));
116
117static cl::opt<bool>
118 RunCSIRInstr("lto-cspgo-gen",
119 cl::desc("Run PGO context sensitive IR instrumentation"),
120 cl::init(false), cl::Hidden);
121
Tim Shen4e912aa2017-06-01 23:13:44 +0000122static cl::opt<bool>
123 UseNewPM("use-new-pm",
124 cl::desc("Run LTO passes using the new pass manager"),
125 cl::init(false), cl::Hidden);
126
Dehao Chen3246dc32017-08-02 03:03:19 +0000127static cl::opt<bool>
128 DebugPassManager("debug-pass-manager", cl::init(false), cl::Hidden,
129 cl::desc("Print pass management debugging information"));
130
Florian Hahnd4332eb2018-04-20 10:18:36 +0000131static cl::opt<std::string>
132 StatsFile("stats-file", cl::desc("Filename to write statistics to"));
133
Teresa Johnson9ba95f92016-08-11 14:58:12 +0000134static void check(Error E, std::string Msg) {
135 if (!E)
136 return;
137 handleAllErrors(std::move(E), [&](ErrorInfoBase &EIB) {
Davide Italianofb6ed912017-02-12 03:42:09 +0000138 errs() << "llvm-lto2: " << Msg << ": " << EIB.message().c_str() << '\n';
Teresa Johnson9ba95f92016-08-11 14:58:12 +0000139 });
140 exit(1);
141}
142
143template <typename T> static T check(Expected<T> E, std::string Msg) {
144 if (E)
145 return std::move(*E);
146 check(E.takeError(), Msg);
147 return T();
148}
149
150static void check(std::error_code EC, std::string Msg) {
151 check(errorCodeToError(EC), Msg);
152}
153
154template <typename T> static T check(ErrorOr<T> E, std::string Msg) {
155 if (E)
156 return std::move(*E);
157 check(E.getError(), Msg);
158 return T();
159}
160
Peter Collingbourne7faa60c2017-04-11 18:12:00 +0000161static int usage() {
Peter Collingbourne94baec62017-04-12 18:27:00 +0000162 errs() << "Available subcommands: dump-symtab run\n";
Peter Collingbourne7faa60c2017-04-11 18:12:00 +0000163 return 1;
164}
Teresa Johnson9ba95f92016-08-11 14:58:12 +0000165
Peter Collingbourne7faa60c2017-04-11 18:12:00 +0000166static int run(int argc, char **argv) {
Teresa Johnson9ba95f92016-08-11 14:58:12 +0000167 cl::ParseCommandLineOptions(argc, argv, "Resolution-based LTO test harness");
168
Peter Collingbournea5b71642016-11-30 23:19:05 +0000169 // FIXME: Workaround PR30396 which means that a symbol can appear
170 // more than once if it is defined in module-level assembly and
171 // has a GV declaration. We allow (file, symbol) pairs to have multiple
172 // resolutions and apply them in the order observed.
173 std::map<std::pair<std::string, std::string>, std::list<SymbolResolution>>
Teresa Johnson9ba95f92016-08-11 14:58:12 +0000174 CommandLineResolutions;
175 for (std::string R : SymbolResolutions) {
176 StringRef Rest = R;
177 StringRef FileName, SymbolName;
178 std::tie(FileName, Rest) = Rest.split(',');
179 if (Rest.empty()) {
180 llvm::errs() << "invalid resolution: " << R << '\n';
181 return 1;
182 }
183 std::tie(SymbolName, Rest) = Rest.split(',');
184 SymbolResolution Res;
185 for (char C : Rest) {
186 if (C == 'p')
187 Res.Prevailing = true;
188 else if (C == 'l')
189 Res.FinalDefinitionInLinkageUnit = true;
190 else if (C == 'x')
191 Res.VisibleToRegularObj = true;
Dmitry Mikulindb3b87b2017-06-05 16:24:25 +0000192 else if (C == 'r')
193 Res.LinkerRedefined = true;
Teresa Johnsona404d142017-03-07 18:15:13 +0000194 else {
Teresa Johnson9ba95f92016-08-11 14:58:12 +0000195 llvm::errs() << "invalid character " << C << " in resolution: " << R
196 << '\n';
Teresa Johnsona404d142017-03-07 18:15:13 +0000197 return 1;
198 }
Teresa Johnson9ba95f92016-08-11 14:58:12 +0000199 }
Peter Collingbournea5b71642016-11-30 23:19:05 +0000200 CommandLineResolutions[{FileName, SymbolName}].push_back(Res);
Teresa Johnson9ba95f92016-08-11 14:58:12 +0000201 }
202
203 std::vector<std::unique_ptr<MemoryBuffer>> MBs;
204
205 Config Conf;
Mehdi Amini14f19bd2016-12-23 23:54:17 +0000206 Conf.DiagHandler = [](const DiagnosticInfo &DI) {
207 DiagnosticPrinterRawOStream DP(errs());
208 DI.print(DP);
209 errs() << '\n';
Teresa Johnsonb77ab092018-05-04 23:59:34 +0000210 if (DI.getSeverity() == DS_Error)
211 exit(1);
Teresa Johnson9ba95f92016-08-11 14:58:12 +0000212 };
213
Peter Collingbournef4257522016-12-08 05:28:30 +0000214 Conf.CPU = MCPU;
215 Conf.Options = InitTargetOptionsFromCodeGenFlags();
216 Conf.MAttrs = MAttrs;
217 if (auto RM = getRelocModel())
218 Conf.RelocModel = *RM;
Rafael Espindola79e238a2017-08-03 02:16:21 +0000219 Conf.CodeModel = getCodeModel();
Peter Collingbournef4257522016-12-08 05:28:30 +0000220
Dehao Chen3246dc32017-08-02 03:03:19 +0000221 Conf.DebugPassManager = DebugPassManager;
222
Teresa Johnson9ba95f92016-08-11 14:58:12 +0000223 if (SaveTemps)
Mehdi Aminieccffad2016-08-18 00:12:33 +0000224 check(Conf.addSaveTemps(OutputFilename + "."),
225 "Config::addSaveTemps failed");
Teresa Johnson9ba95f92016-08-11 14:58:12 +0000226
Davide Italianoebd47192017-02-12 03:31:30 +0000227 // Optimization remarks.
228 Conf.RemarksFilename = OptRemarksOutput;
Francis Visoiu Mistrihdd422362019-03-12 21:22:27 +0000229 Conf.RemarksPasses = OptRemarksPasses;
Davide Italianocd6d7b12017-02-13 16:08:36 +0000230 Conf.RemarksWithHotness = OptRemarksWithHotness;
Davide Italianoebd47192017-02-12 03:31:30 +0000231
Tobias Edler von Koch819d8402017-07-28 23:43:22 +0000232 Conf.SampleProfile = SamplePGOFile;
Rong Xu6cdf3d82019-02-27 17:24:33 +0000233 Conf.CSIRProfile = CSPGOFile;
234 Conf.RunCSIRInstr = RunCSIRInstr;
Tobias Edler von Koch819d8402017-07-28 23:43:22 +0000235
Davide Italianoec9612d2016-09-07 17:46:16 +0000236 // Run a custom pipeline, if asked for.
237 Conf.OptPipeline = OptPipeline;
Davide Italiano14e9e8a2016-09-16 21:03:21 +0000238 Conf.AAPipeline = AAPipeline;
Davide Italianoec9612d2016-09-07 17:46:16 +0000239
Teresa Johnson002af9b2016-10-31 22:12:21 +0000240 Conf.OptLevel = OptLevel - '0';
Tim Shen4e912aa2017-06-01 23:13:44 +0000241 Conf.UseNewPM = UseNewPM;
Peter Collingbournef4257522016-12-08 05:28:30 +0000242 switch (CGOptLevel) {
243 case '0':
244 Conf.CGOptLevel = CodeGenOpt::None;
245 break;
246 case '1':
247 Conf.CGOptLevel = CodeGenOpt::Less;
248 break;
249 case '2':
250 Conf.CGOptLevel = CodeGenOpt::Default;
251 break;
252 case '3':
253 Conf.CGOptLevel = CodeGenOpt::Aggressive;
254 break;
255 default:
256 llvm::errs() << "invalid cg optimization level: " << CGOptLevel << '\n';
257 return 1;
258 }
259
Tobias Edler von Kochf454b9e2017-02-15 20:36:36 +0000260 if (FileType.getNumOccurrences())
261 Conf.CGFileType = FileType;
262
Peter Collingbournef4257522016-12-08 05:28:30 +0000263 Conf.OverrideTriple = OverrideTriple;
264 Conf.DefaultTriple = DefaultTriple;
Florian Hahnd4332eb2018-04-20 10:18:36 +0000265 Conf.StatsFile = StatsFile;
Teresa Johnson002af9b2016-10-31 22:12:21 +0000266
Mehdi Amini458f8052016-08-19 23:54:40 +0000267 ThinBackend Backend;
268 if (ThinLTODistributedIndexes)
Vitaly Bukaa139b692018-02-22 19:06:15 +0000269 Backend = createWriteIndexesThinBackend(/* OldPrefix */ "",
270 /* NewPrefix */ "",
271 /* ShouldEmitImportsFiles */ true,
272 /* LinkedObjectsFile */ nullptr,
273 /* OnWrite */ {});
Mehdi Amini458f8052016-08-19 23:54:40 +0000274 else
275 Backend = createInProcessThinBackend(Threads);
276 LTO Lto(std::move(Conf), std::move(Backend));
Teresa Johnson9ba95f92016-08-11 14:58:12 +0000277
278 bool HasErrors = false;
279 for (std::string F : InputFilenames) {
280 std::unique_ptr<MemoryBuffer> MB = check(MemoryBuffer::getFile(F), F);
281 std::unique_ptr<InputFile> Input =
282 check(InputFile::create(MB->getMemBufferRef()), F);
283
284 std::vector<SymbolResolution> Res;
285 for (const InputFile::Symbol &Sym : Input->symbols()) {
286 auto I = CommandLineResolutions.find({F, Sym.getName()});
287 if (I == CommandLineResolutions.end()) {
288 llvm::errs() << argv[0] << ": missing symbol resolution for " << F
289 << ',' << Sym.getName() << '\n';
290 HasErrors = true;
291 } else {
Peter Collingbournea5b71642016-11-30 23:19:05 +0000292 Res.push_back(I->second.front());
293 I->second.pop_front();
294 if (I->second.empty())
295 CommandLineResolutions.erase(I);
Teresa Johnson9ba95f92016-08-11 14:58:12 +0000296 }
297 }
298
299 if (HasErrors)
300 continue;
301
302 MBs.push_back(std::move(MB));
303 check(Lto.add(std::move(Input), Res), F);
304 }
305
306 if (!CommandLineResolutions.empty()) {
307 HasErrors = true;
308 for (auto UnusedRes : CommandLineResolutions)
309 llvm::errs() << argv[0] << ": unused symbol resolution for "
310 << UnusedRes.first.first << ',' << UnusedRes.first.second
311 << '\n';
312 }
313 if (HasErrors)
314 return 1;
315
Peter Collingbourne80186a52016-09-23 21:33:43 +0000316 auto AddStream =
317 [&](size_t Task) -> std::unique_ptr<lto::NativeObjectStream> {
Teresa Johnson9ba95f92016-08-11 14:58:12 +0000318 std::string Path = OutputFilename + "." + utostr(Task);
Mehdi Aminiadc0e262016-08-23 21:30:12 +0000319
Peter Collingbourne80186a52016-09-23 21:33:43 +0000320 std::error_code EC;
321 auto S = llvm::make_unique<raw_fd_ostream>(Path, EC, sys::fs::F_None);
322 check(EC, Path);
323 return llvm::make_unique<lto::NativeObjectStream>(std::move(S));
Teresa Johnson9ba95f92016-08-11 14:58:12 +0000324 };
325
Teresa Johnsona344fd32018-02-20 20:21:53 +0000326 auto AddBuffer = [&](size_t Task, std::unique_ptr<MemoryBuffer> MB) {
Peter Collingbourne128423f2017-03-17 00:34:07 +0000327 *AddStream(Task)->OS << MB->getBuffer();
Peter Collingbourne80186a52016-09-23 21:33:43 +0000328 };
329
330 NativeObjectCache Cache;
331 if (!CacheDir.empty())
Peter Collingbourne128423f2017-03-17 00:34:07 +0000332 Cache = check(localCache(CacheDir, AddBuffer), "failed to create cache");
Peter Collingbourne80186a52016-09-23 21:33:43 +0000333
334 check(Lto.run(AddStream, Cache), "LTO::run failed");
Peter Collingbourne7faa60c2017-04-11 18:12:00 +0000335 return 0;
336}
337
Peter Collingbourne94baec62017-04-12 18:27:00 +0000338static int dumpSymtab(int argc, char **argv) {
339 for (StringRef F : make_range(argv + 1, argv + argc)) {
340 std::unique_ptr<MemoryBuffer> MB = check(MemoryBuffer::getFile(F), F);
Peter Collingbourne99b98c22017-06-27 23:50:24 +0000341 BitcodeFileContents BFC = check(getBitcodeFileContents(*MB), F);
342
343 if (BFC.Symtab.size() >= sizeof(irsymtab::storage::Header)) {
344 auto *Hdr = reinterpret_cast<const irsymtab::storage::Header *>(
345 BFC.Symtab.data());
346 outs() << "version: " << Hdr->Version << '\n';
347 if (Hdr->Version == irsymtab::storage::Header::kCurrentVersion)
348 outs() << "producer: " << Hdr->Producer.get(BFC.StrtabForSymtab)
349 << '\n';
350 }
351
Peter Collingbourne94baec62017-04-12 18:27:00 +0000352 std::unique_ptr<InputFile> Input =
353 check(InputFile::create(MB->getMemBufferRef()), F);
354
Peter Collingbourne8446f1f2017-04-14 02:55:06 +0000355 outs() << "target triple: " << Input->getTargetTriple() << '\n';
356 Triple TT(Input->getTargetTriple());
357
Peter Collingbourne94baec62017-04-12 18:27:00 +0000358 outs() << "source filename: " << Input->getSourceFileName() << '\n';
Peter Collingbourne8446f1f2017-04-14 02:55:06 +0000359
360 if (TT.isOSBinFormatCOFF())
361 outs() << "linker opts: " << Input->getCOFFLinkerOpts() << '\n';
Peter Collingbourne94baec62017-04-12 18:27:00 +0000362
363 std::vector<StringRef> ComdatTable = Input->getComdatTable();
364 for (const InputFile::Symbol &Sym : Input->symbols()) {
365 switch (Sym.getVisibility()) {
366 case GlobalValue::HiddenVisibility:
367 outs() << 'H';
368 break;
369 case GlobalValue::ProtectedVisibility:
370 outs() << 'P';
371 break;
372 case GlobalValue::DefaultVisibility:
373 outs() << 'D';
374 break;
375 }
376
377 auto PrintBool = [&](char C, bool B) { outs() << (B ? C : '-'); };
378 PrintBool('U', Sym.isUndefined());
379 PrintBool('C', Sym.isCommon());
380 PrintBool('W', Sym.isWeak());
381 PrintBool('I', Sym.isIndirect());
382 PrintBool('O', Sym.canBeOmittedFromSymbolTable());
383 PrintBool('T', Sym.isTLS());
Tobias Edler von Koch90df1f482017-04-13 16:24:14 +0000384 PrintBool('X', Sym.isExecutable());
Peter Collingbourne94baec62017-04-12 18:27:00 +0000385 outs() << ' ' << Sym.getName() << '\n';
386
387 if (Sym.isCommon())
Tobias Edler von Koch90df1f482017-04-13 16:24:14 +0000388 outs() << " size " << Sym.getCommonSize() << " align "
Peter Collingbourne94baec62017-04-12 18:27:00 +0000389 << Sym.getCommonAlignment() << '\n';
390
391 int Comdat = Sym.getComdatIndex();
392 if (Comdat != -1)
Tobias Edler von Koch90df1f482017-04-13 16:24:14 +0000393 outs() << " comdat " << ComdatTable[Comdat] << '\n';
Peter Collingbourne94baec62017-04-12 18:27:00 +0000394
Peter Collingbourne8446f1f2017-04-14 02:55:06 +0000395 if (TT.isOSBinFormatCOFF() && Sym.isWeak() && Sym.isIndirect())
Tobias Edler von Koch90df1f482017-04-13 16:24:14 +0000396 outs() << " fallback " << Sym.getCOFFWeakExternalFallback() << '\n';
Teresa Johnsona83c3f72017-07-25 19:42:32 +0000397
398 if (!Sym.getSectionName().empty())
399 outs() << " section " << Sym.getSectionName() << "\n";
Peter Collingbourne94baec62017-04-12 18:27:00 +0000400 }
401
402 outs() << '\n';
403 }
404
405 return 0;
406}
407
Peter Collingbourne7faa60c2017-04-11 18:12:00 +0000408int main(int argc, char **argv) {
Teresa Johnson0bc6b7b2018-10-16 17:37:45 +0000409 InitLLVM X(argc, argv);
Peter Collingbourne7faa60c2017-04-11 18:12:00 +0000410 InitializeAllTargets();
411 InitializeAllTargetMCs();
412 InitializeAllAsmPrinters();
413 InitializeAllAsmParsers();
414
415 // FIXME: This should use llvm::cl subcommands, but it isn't currently
416 // possible to pass an argument not associated with a subcommand to a
Tim Shen4e912aa2017-06-01 23:13:44 +0000417 // subcommand (e.g. -use-new-pm).
Peter Collingbourne7faa60c2017-04-11 18:12:00 +0000418 if (argc < 2)
419 return usage();
420
421 StringRef Subcommand = argv[1];
422 // Ensure that argv[0] is correct after adjusting argv/argc.
423 argv[1] = argv[0];
Peter Collingbourne94baec62017-04-12 18:27:00 +0000424 if (Subcommand == "dump-symtab")
425 return dumpSymtab(argc - 1, argv + 1);
Peter Collingbourne7faa60c2017-04-11 18:12:00 +0000426 if (Subcommand == "run")
427 return run(argc - 1, argv + 1);
428 return usage();
Teresa Johnson9ba95f92016-08-11 14:58:12 +0000429}