1*f4a2713aSLionel Sambuc //===- diagtool_main.h - Entry point for invoking all diagnostic tools ----===// 2*f4a2713aSLionel Sambuc // 3*f4a2713aSLionel Sambuc // The LLVM Compiler Infrastructure 4*f4a2713aSLionel Sambuc // 5*f4a2713aSLionel Sambuc // This file is distributed under the University of Illinois Open Source 6*f4a2713aSLionel Sambuc // License. See LICENSE.TXT for details. 7*f4a2713aSLionel Sambuc // 8*f4a2713aSLionel Sambuc //===----------------------------------------------------------------------===// 9*f4a2713aSLionel Sambuc // 10*f4a2713aSLionel Sambuc // This file implements the main function for diagtool. 11*f4a2713aSLionel Sambuc // 12*f4a2713aSLionel Sambuc //===----------------------------------------------------------------------===// 13*f4a2713aSLionel Sambuc 14*f4a2713aSLionel Sambuc #include "DiagTool.h" 15*f4a2713aSLionel Sambuc 16*f4a2713aSLionel Sambuc using namespace diagtool; 17*f4a2713aSLionel Sambuc main(int argc,char * argv[])18*f4a2713aSLionel Sambucint main(int argc, char *argv[]) { 19*f4a2713aSLionel Sambuc if (argc > 1) 20*f4a2713aSLionel Sambuc if (DiagTool *tool = diagTools->getTool(argv[1])) 21*f4a2713aSLionel Sambuc return tool->run(argc - 2, &argv[2], llvm::outs()); 22*f4a2713aSLionel Sambuc 23*f4a2713aSLionel Sambuc llvm::errs() << "usage: diagtool <command> [<args>]\n\n"; 24*f4a2713aSLionel Sambuc diagTools->printCommands(llvm::errs()); 25*f4a2713aSLionel Sambuc return 1; 26*f4a2713aSLionel Sambuc } 27