Skip to content

Commit

Permalink
[clang][doc] Improve error handling for LibTooling example code avo…
Browse files Browse the repository at this point in the history
…iding core dump

Resolves llvm#97983
  • Loading branch information
Rajveer100 committed Jul 9, 2024
1 parent 00c622e commit e20e592
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions clang/docs/LibTooling.rst
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ and automatic location of the compilation database using source files paths.
auto ExpectedParser = CommonOptionsParser::create(argc, argv, MyToolCategory);
if (!ExpectedParser) {
// Fail gracefully for unsupported options.
llvm::errs() << ExpectedParser.takeError();
llvm::errs() << toString(ExpectedParser.takeError());
return 1;
}
CommonOptionsParser& OptionsParser = ExpectedParser.get();
Expand Down Expand Up @@ -142,7 +142,7 @@ version of this example tool is also checked into the clang tree at
int main(int argc, const char **argv) {
auto ExpectedParser = CommonOptionsParser::create(argc, argv, MyToolCategory);
if (!ExpectedParser) {
llvm::errs() << ExpectedParser.takeError();
llvm::errs() << toString(ExpectedParser.takeError());
return 1;
}
CommonOptionsParser& OptionsParser = ExpectedParser.get();
Expand Down

0 comments on commit e20e592

Please sign in to comment.