File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -385,12 +385,18 @@ namespace Parser
385385 ClangParser::g_locationFilter = filter;
386386 }
387387
388- bool Parse (int argc, const char * argv[])
389- {
388+ bool Parse (int argc, const char * argv[])
389+ {
390390 llvm::InitializeNativeTarget ();
391391 llvm::InitializeNativeTargetAsmParser ();
392392
393393 llvm::Expected<clang::tooling::CommonOptionsParser> optionsParser = clang::tooling::CommonOptionsParser::create (argc, argv, CommandLine::g_commandLineCategory);
394+ if (!optionsParser)
395+ {
396+ llvm::errs () << " Failed to create options parser: " << llvm::toString (optionsParser.takeError ()) << " \n " ;
397+ return false ;
398+ }
399+
394400 clang::tooling::ClangTool tool (optionsParser->getCompilations (), optionsParser->getSourcePathList ());
395401
396402 SetFilter (ClangParser::LocationFilter{ CommandLine::g_locationRow, CommandLine::g_locationCol });
@@ -406,5 +412,5 @@ namespace Parser
406412
407413 ClangParser::Helpers::ClearResult ();
408414 return ret;
409- }
415+ }
410416}
You can’t perform that action at this time.
0 commit comments