1//===- diagtool_main.h - Entry point for invoking all diagnostic tools ----===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8//
9// This file implements the main function for diagtool.
10//
11//===----------------------------------------------------------------------===//
12
13#include "DiagTool.h"
14
15using namespace diagtool;
16
17int main(int argc, char *argv[]) {
18 if (argc > 1)
19 if (DiagTool *tool = diagTools->getTool(toolCmd: argv[1]))
20 return tool->run(argc: argc - 2, argv: &argv[2], out&: llvm::outs());
21
22 llvm::errs() << "usage: diagtool <command> [<args>]\n\n";
23 diagTools->printCommands(out&: llvm::errs());
24 return 1;
25}
26

source code of clang/tools/diagtool/diagtool_main.cpp