Chris Lattner | fb74224 | 2003-05-03 03:18:41 +0000 | [diff] [blame] | 1 | //===- bugpoint.cpp - The LLVM BugPoint utility ---------------------------===// |
Chris Lattner | afade92 | 2002-11-20 22:28:10 +0000 | [diff] [blame] | 2 | // |
| 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" |
Chris Lattner | afade92 | 2002-11-20 22:28:10 +0000 | [diff] [blame] | 10 | #include "llvm/Support/PassNameParser.h" |
Misha Brukman | e49603d | 2003-08-07 21:19:30 +0000 | [diff] [blame^] | 11 | #include "Support/CommandLine.h" |
Chris Lattner | afade92 | 2002-11-20 22:28:10 +0000 | [diff] [blame] | 12 | |
| 13 | static cl::list<std::string> |
| 14 | InputFilenames(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 | // |
| 20 | static cl::list<const PassInfo*, bool, PassNameParser> |
Misha Brukman | 5073336 | 2003-07-24 18:17:43 +0000 | [diff] [blame] | 21 | PassList(cl::desc("Passes available:"), cl::ZeroOrMore); |
Chris Lattner | afade92 | 2002-11-20 22:28:10 +0000 | [diff] [blame] | 22 | |
Chris Lattner | afade92 | 2002-11-20 22:28:10 +0000 | [diff] [blame] | 23 | int main(int argc, char **argv) { |
| 24 | cl::ParseCommandLineOptions(argc, argv); |
| 25 | |
Chris Lattner | afade92 | 2002-11-20 22:28:10 +0000 | [diff] [blame] | 26 | BugDriver D(argv[0]); |
| 27 | if (D.addSources(InputFilenames)) return 1; |
| 28 | D.addPasses(PassList.begin(), PassList.end()); |
| 29 | |
| 30 | return D.run(); |
| 31 | } |