26#ifndef LLVM_CLANG_TOOLING_COMMONOPTIONSPARSER_H
27#define LLVM_CLANG_TOOLING_COMMONOPTIONSPARSER_H
31#include "llvm/Support/CommandLine.h"
32#include "llvm/Support/Error.h"
77 int &argc,
const char **argv, llvm::cl::OptionCategory &
Category,
78 llvm::cl::NumOccurrencesFlag OccurrencesFlag = llvm::cl::OneOrMore,
79 const char *Overview =
nullptr);
85 create(
int &argc,
const char **argv, llvm::cl::OptionCategory &
Category,
86 llvm::cl::NumOccurrencesFlag OccurrencesFlag = llvm::cl::OneOrMore,
87 const char *Overview =
nullptr);
96 return SourcePathList;
108 llvm::Error init(
int &argc,
const char **argv,
110 llvm::cl::NumOccurrencesFlag OccurrencesFlag,
111 const char *Overview);
113 std::unique_ptr<CompilationDatabase> Compilations;
114 std::vector<std::string> SourcePathList;
121 std::unique_ptr<CompilationDatabase> Compilations)
122 : Compilations(
std::move(Compilations)) {}
126 std::vector<CompileCommand>
129 std::vector<std::string>
getAllFiles()
const override;
134 std::unique_ptr<CompilationDatabase> Compilations;
135 std::vector<ArgumentsAdjuster> Adjusters;
137 std::vector<CompileCommand>
138 adjustCommands(std::vector<CompileCommand> Commands)
const;