blob: d58d0a6d868e3ab40baa41d7ee2450c21a26b874 [file] [log] [blame]
Chris Lattnerafade922002-11-20 22:28:10 +00001//===----------------------------------------------------------------------===//
2// LLVM BugPoint Utility
3//
4// This program is an automated compiler debugger tool. It is used to narrow
5// down miscompilations and crash problems to a specific pass in the compiler,
6// and the specific Module or Function input that is causing the problem.
7//
8//===----------------------------------------------------------------------===//
9
10#include "BugDriver.h"
11#include "Support/CommandLine.h"
12#include "llvm/Support/PassNameParser.h"
13
14static cl::list<std::string>
15InputFilenames(cl::Positional, cl::OneOrMore,
16 cl::desc("<input llvm ll/bc files>"));
17
18// The AnalysesList is automatically populated with registered Passes by the
19// PassNameParser.
20//
21static cl::list<const PassInfo*, bool, PassNameParser>
22PassList(cl::desc("Passes available:"), cl::OneOrMore);
23
24//cl::list<std::string>
25//InputArgv(cl::ConsumeAfter, cl::desc("<program arguments>..."));
26
27//cl::opt<bool>
28//Verbose("v", cl::desc("Enable verbose output"));
29
30int main(int argc, char **argv) {
31 cl::ParseCommandLineOptions(argc, argv);
32
33
34 BugDriver D(argv[0]);
35 if (D.addSources(InputFilenames)) return 1;
36 D.addPasses(PassList.begin(), PassList.end());
37
38 return D.run();
39}