Skip to content

Commit 2bc825e

Browse files
committed
Update documentation to match recent API change. newFrontendActionFactory now returns a unique_ptr.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@207789 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent c355489 commit 2bc825e

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

docs/LibASTMatchersTutorial.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ documentation <LibTooling.html>`_.
153153
CommonOptionsParser OptionsParser(argc, argv, MyToolCategory);
154154
ClangTool Tool(OptionsParser.getCompilations(),
155155
OptionsParser.getSourcePathList());
156-
return Tool.run(newFrontendActionFactory<clang::SyntaxOnlyAction>());
156+
return Tool.run(newFrontendActionFactory<clang::SyntaxOnlyAction>().get());
157157
}
158158
159159
And that's it! You can compile our new tool by running ninja from the
@@ -299,7 +299,7 @@ And change ``main()`` to:
299299
MatchFinder Finder;
300300
Finder.addMatcher(LoopMatcher, &Printer);
301301

302-
return Tool.run(newFrontendActionFactory(&Finder));
302+
return Tool.run(newFrontendActionFactory(&Finder).get());
303303
}
304304

305305
Now, you should be able to recompile and run the code to discover for

docs/LibTooling.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ our ``FrontendAction`` over some code. For example, to run the
9999
// on. Thus, it takes a FrontendActionFactory as parameter. To create a
100100
// FrontendActionFactory from a given FrontendAction type, we call
101101
// newFrontendActionFactory<clang::SyntaxOnlyAction>().
102-
int result = Tool.run(newFrontendActionFactory<clang::SyntaxOnlyAction>());
102+
int result = Tool.run(newFrontendActionFactory<clang::SyntaxOnlyAction>().get());
103103

104104
Putting it together --- the first tool
105105
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -136,7 +136,7 @@ version of this example tool is also checked into the clang tree at
136136
CommonOptionsParser OptionsParser(argc, argv, MyToolCategory);
137137
ClangTool Tool(OptionsParser.getCompilations(),
138138
OptionsParser.getSourcePathList());
139-
return Tool.run(newFrontendActionFactory<clang::SyntaxOnlyAction>());
139+
return Tool.run(newFrontendActionFactory<clang::SyntaxOnlyAction>().get());
140140
}
141141
142142
Running the tool on some code

0 commit comments

Comments
 (0)