[clang][modules] Don't prevent translation of FW_Private includes when explicitly...
[llvm-project.git] / llvm / tools / llvm-remarkutil / RemarkUtil.cpp
blob8ab3fbba4311d1a01c8c91288719218c1de30a0c
1 //===--------- llvm-remarkutil/RemarkUtil.cpp -----------------------------===//
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 /// Utility for remark files.
9 //===----------------------------------------------------------------------===//
11 #include "RemarkUtilRegistry.h"
12 #include "llvm/Support/InitLLVM.h"
14 using namespace llvm;
15 using namespace llvm::remarkutil;
16 ExitOnError ExitOnErr;
18 static Error handleSubOptions() {
19 for (auto *SC : cl::getRegisteredSubcommands()) {
20 if (*SC) {
21 // If no subcommand was provided, we need to explicitly check if this is
22 // the top-level subcommand.
23 if (SC == &cl::SubCommand::getTopLevel())
24 break;
25 if (auto C = dispatch(SC)) {
26 return C();
31 return make_error<StringError>(
32 "Please specify a subcommand. (See -help for options)",
33 inconvertibleErrorCode());
36 int main(int argc, char *argv[]) {
37 InitLLVM X(argc, argv);
38 cl::ParseCommandLineOptions(argc, argv, "Remark file utilities\n");
39 ExitOnErr.setBanner(std::string(argv[0]) + ": error: ");
40 ExitOnErr(handleSubOptions());