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