Ted Kremenek | 2dc651d | 2011-08-09 03:39:19 +0000 | [diff] [blame] | 1 | //===- diagtool_main.h - Entry point for invoking all diagnostic tools ----===// |
| 2 | // |
| 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
| 5 | // This file is distributed under the University of Illinois Open Source |
| 6 | // License. See LICENSE.TXT for details. |
| 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | // |
| 10 | // This file implements the main function for diagtool. |
| 11 | // |
| 12 | //===----------------------------------------------------------------------===// |
| 13 | |
| 14 | #include "DiagTool.h" |
| 15 | |
| 16 | using namespace diagtool; |
| 17 | |
| 18 | int main(int argc, char *argv[]) { |
| 19 | if (argc > 1) |
Nick Lewycky | 83f06e8 | 2011-08-12 01:14:22 +0000 | [diff] [blame] | 20 | if (DiagTool *tool = diagTools->getTool(argv[1])) |
Jordan Rose | 0764573 | 2012-06-22 00:33:20 +0000 | [diff] [blame] | 21 | return tool->run(argc - 2, &argv[2], llvm::outs()); |
Ted Kremenek | 2dc651d | 2011-08-09 03:39:19 +0000 | [diff] [blame] | 22 | |
| 23 | llvm::errs() << "usage: diagtool <command> [<args>]\n\n"; |
Nick Lewycky | 83f06e8 | 2011-08-12 01:14:22 +0000 | [diff] [blame] | 24 | diagTools->printCommands(llvm::errs()); |
Ted Kremenek | 2dc651d | 2011-08-09 03:39:19 +0000 | [diff] [blame] | 25 | return 1; |
| 26 | } |