Path: blob/main/contrib/llvm-project/llvm/tools/llvm-remarkutil/RemarkUtil.cpp
35231 views
//===--------- llvm-remarkutil/RemarkUtil.cpp -----------------------------===//1//2// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.3// See https://llvm.org/LICENSE.txt for license information.4// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception5//6//===----------------------------------------------------------------------===//7/// Utility for remark files.8//===----------------------------------------------------------------------===//910#include "RemarkUtilRegistry.h"11#include "llvm/Support/InitLLVM.h"1213using namespace llvm;14using namespace llvm::remarkutil;15ExitOnError ExitOnErr;1617static Error handleSubOptions() {18for (auto *SC : cl::getRegisteredSubcommands()) {19if (*SC) {20// If no subcommand was provided, we need to explicitly check if this is21// the top-level subcommand.22if (SC == &cl::SubCommand::getTopLevel())23break;24if (auto C = dispatch(SC)) {25return C();26}27}28}2930return make_error<StringError>(31"Please specify a subcommand. (See -help for options)",32inconvertibleErrorCode());33}3435int main(int argc, char *argv[]) {36InitLLVM X(argc, argv);37cl::ParseCommandLineOptions(argc, argv, "Remark file utilities\n");38ExitOnErr.setBanner(std::string(argv[0]) + ": error: ");39ExitOnErr(handleSubOptions());40}414243