From 222e2a7620e6520ffaf4fc4e69d79c18da31542e Mon Sep 17 00:00:00 2001 From: "Zancanaro; Carlo" Date: Mon, 24 Sep 2012 09:58:17 +1000 Subject: Add the clang library to the repo (with some of my changes, too). --- clang/tools/diagtool/diagtool_main.cpp | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 clang/tools/diagtool/diagtool_main.cpp (limited to 'clang/tools/diagtool/diagtool_main.cpp') diff --git a/clang/tools/diagtool/diagtool_main.cpp b/clang/tools/diagtool/diagtool_main.cpp new file mode 100644 index 0000000..e34f0dc --- /dev/null +++ b/clang/tools/diagtool/diagtool_main.cpp @@ -0,0 +1,26 @@ +//===- diagtool_main.h - Entry point for invoking all diagnostic tools ----===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// This file implements the main function for diagtool. +// +//===----------------------------------------------------------------------===// + +#include "DiagTool.h" + +using namespace diagtool; + +int main(int argc, char *argv[]) { + if (argc > 1) + if (DiagTool *tool = diagTools->getTool(argv[1])) + return tool->run(argc - 1, &argv[2], llvm::errs()); + + llvm::errs() << "usage: diagtool []\n\n"; + diagTools->printCommands(llvm::errs()); + return 1; +} -- cgit v1.2.3