blob: 4eef54dbfece9be62fe6d385f21847e3789597b5 [file] [log] [blame]
Ted Kremenek2dc651d2011-08-09 03:39:19 +00001//===- 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
16using namespace diagtool;
17
18int main(int argc, char *argv[]) {
19 if (argc > 1)
Nick Lewycky83f06e82011-08-12 01:14:22 +000020 if (DiagTool *tool = diagTools->getTool(argv[1]))
Jordan Rose07645732012-06-22 00:33:20 +000021 return tool->run(argc - 2, &argv[2], llvm::outs());
Ted Kremenek2dc651d2011-08-09 03:39:19 +000022
23 llvm::errs() << "usage: diagtool <command> [<args>]\n\n";
Nick Lewycky83f06e82011-08-12 01:14:22 +000024 diagTools->printCommands(llvm::errs());
Ted Kremenek2dc651d2011-08-09 03:39:19 +000025 return 1;
26}