Updates LLVM usage to match
[1c762a81d20f](https://github.com/llvm/llvm-project/commit/1c762a81d20f)

PiperOrigin-RevId: 354567452
Change-Id: I29758805e7e2030d014bbc0007f5c548f119246f
This commit is contained in:
Sandboxed API Team 2021-01-29 11:02:17 -08:00 committed by Copybara-Service
parent 552a510777
commit 6dcef3d5c9

View File

@ -98,9 +98,13 @@ GeneratorOptions GeneratorOptionsFromFlags(
}
absl::Status GeneratorMain(int argc, const char** argv) {
clang::tooling::CommonOptionsParser opt_parser(
auto expected_opt_parser = clang::tooling::CommonOptionsParser::create(
argc, argv, *sapi::g_tool_category, llvm::cl::ZeroOrMore,
"Generates a Sandboxed API header for C/C++ translation units.");
if (!expected_opt_parser) {
return absl::InternalError(llvm::toString(expected_opt_parser.takeError()));
}
clang::tooling::CommonOptionsParser& opt_parser = expected_opt_parser.get();
std::vector<std::string> sources = opt_parser.getSourcePathList();
for (const auto& sapi_in : *sapi::g_sapi_in) {
sources.push_back(sapi_in);