diff --git a/lldb/tools/lldb-instr/Instrument.cpp b/lldb/tools/lldb-instr/Instrument.cpp index 8ec01304891b4..8fbc3e64833cb 100644 --- a/lldb/tools/lldb-instr/Instrument.cpp +++ b/lldb/tools/lldb-instr/Instrument.cpp @@ -342,9 +342,15 @@ class SBAction : public ASTFrontendAction { }; int main(int argc, const char **argv) { - CommonOptionsParser OP(argc, argv, InstrCategory, - "Utility for generating the macros for LLDB's " - "instrumentation framework."); + auto ExpectedParser = CommonOptionsParser::create( + argc, argv, InstrCategory, llvm::cl::OneOrMore, + "Utility for generating the macros for LLDB's " + "instrumentation framework."); + if (!ExpectedParser) { + llvm::errs() << ExpectedParser.takeError(); + return 1; + } + CommonOptionsParser &OP = ExpectedParser.get(); auto PCHOpts = std::make_shared(); PCHOpts->registerWriter(std::make_unique());