feat(tidy): Add new fairmq-tidy tool

This commit is contained in:
Dennis Klein
2021-06-15 13:56:40 +02:00
committed by Dennis Klein
parent 139a223c31
commit 5e930d4d37
8 changed files with 236 additions and 3 deletions

29
fairmq/tidy/runTool.cpp Normal file
View File

@@ -0,0 +1,29 @@
/********************************************************************************
* Copyright (C) 2021 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
* *
* This software is distributed under the terms of the *
* GNU Lesser General Public Licence (LGPL) version 3, *
* copied verbatim in the file "LICENSE" *
********************************************************************************/
#include <clang/Tooling/CommonOptionsParser.h>
#include <clang/Tooling/Tooling.h>
#include <fairmq/tidy/Tool.h>
#include <llvm/ADT/STLExtras.h>
#include <llvm/Support/CommandLine.h>
static llvm::cl::OptionCategory ToolCategory("fairmq-tidy options");
static llvm::cl::extrahelp CommonHelp(clang::tooling::CommonOptionsParser::HelpMessage);
int main(int argc, const char** argv)
{
// TODO Replace command line parser with CLI11
auto parser(clang::tooling::CommonOptionsParser::create(
argc, argv, ToolCategory, llvm::cl::NumOccurrencesFlag::Optional, ""));
if (!parser) {
llvm::errs() << parser.takeError();
return EXIT_FAILURE;
}
return fair::mq::tidy::Tool::run(parser->getCompilations(), parser->getSourcePathList());
}