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 
main(int argc,char * argv[])18 int main(int argc, char *argv[]) {
19   if (argc > 1)
20     if (DiagTool *tool = diagTools->getTool(argv[1]))
21       return tool->run(argc - 2, &argv[2], llvm::outs());
22 
23   llvm::errs() << "usage: diagtool <command> [<args>]\n\n";
24   diagTools->printCommands(llvm::errs());
25   return 1;
26 }
27