| Chris Lattner | afade92 | 2002-11-20 22:28:10 +0000 | [diff] [blame^] | 1 | //===----------------------------------------------------------------------===// | 
|  | 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 |  | 
|  | 14 | static cl::list<std::string> | 
|  | 15 | InputFilenames(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 | // | 
|  | 21 | static cl::list<const PassInfo*, bool, PassNameParser> | 
|  | 22 | PassList(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 |  | 
|  | 30 | int 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 | } |