r207789 - Update documentation to match recent API change. newFrontendActionFactory now returns a unique_ptr.

Nico Weber thakis at chromium.org
Thu May 1 13:12:52 PDT 2014


Thanks! Sorry for yet another thing I missed in that change.

(On the plus side, the change found that our documentation contained a
memory leak, so that's something I suppose.)

On Thu, May 1, 2014 at 1:04 PM, Richard Smith
<richard-llvm at metafoo.co.uk> wrote:
> Author: rsmith
> Date: Thu May  1 15:04:39 2014
> New Revision: 207789
>
> URL: http://llvm.org/viewvc/llvm-project?rev=207789&view=rev
> Log:
> Update documentation to match recent API change. newFrontendActionFactory now returns a unique_ptr.
>
> Modified:
>     cfe/trunk/docs/LibASTMatchersTutorial.rst
>     cfe/trunk/docs/LibTooling.rst
>
> Modified: cfe/trunk/docs/LibASTMatchersTutorial.rst
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/docs/LibASTMatchersTutorial.rst?rev=207789&r1=207788&r2=207789&view=diff
> ==============================================================================
> --- cfe/trunk/docs/LibASTMatchersTutorial.rst (original)
> +++ cfe/trunk/docs/LibASTMatchersTutorial.rst Thu May  1 15:04:39 2014
> @@ -153,7 +153,7 @@ documentation <LibTooling.html>`_.
>          CommonOptionsParser OptionsParser(argc, argv, MyToolCategory);
>          ClangTool Tool(OptionsParser.getCompilations(),
>                         OptionsParser.getSourcePathList());
> -        return Tool.run(newFrontendActionFactory<clang::SyntaxOnlyAction>());
> +        return Tool.run(newFrontendActionFactory<clang::SyntaxOnlyAction>().get());
>        }
>
>  And that's it! You can compile our new tool by running ninja from the
> @@ -299,7 +299,7 @@ And change ``main()`` to:
>          MatchFinder Finder;
>          Finder.addMatcher(LoopMatcher, &Printer);
>
> -        return Tool.run(newFrontendActionFactory(&Finder));
> +        return Tool.run(newFrontendActionFactory(&Finder).get());
>        }
>
>  Now, you should be able to recompile and run the code to discover for
>
> Modified: cfe/trunk/docs/LibTooling.rst
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/docs/LibTooling.rst?rev=207789&r1=207788&r2=207789&view=diff
> ==============================================================================
> --- cfe/trunk/docs/LibTooling.rst (original)
> +++ cfe/trunk/docs/LibTooling.rst Thu May  1 15:04:39 2014
> @@ -99,7 +99,7 @@ our ``FrontendAction`` over some code.
>    // on.  Thus, it takes a FrontendActionFactory as parameter.  To create a
>    // FrontendActionFactory from a given FrontendAction type, we call
>    // newFrontendActionFactory<clang::SyntaxOnlyAction>().
> -  int result = Tool.run(newFrontendActionFactory<clang::SyntaxOnlyAction>());
> +  int result = Tool.run(newFrontendActionFactory<clang::SyntaxOnlyAction>().get());
>
>  Putting it together --- the first tool
>  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> @@ -136,7 +136,7 @@ version of this example tool is also che
>      CommonOptionsParser OptionsParser(argc, argv, MyToolCategory);
>      ClangTool Tool(OptionsParser.getCompilations(),
>                     OptionsParser.getSourcePathList());
> -    return Tool.run(newFrontendActionFactory<clang::SyntaxOnlyAction>());
> +    return Tool.run(newFrontendActionFactory<clang::SyntaxOnlyAction>().get());
>    }
>
>  Running the tool on some code
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits



More information about the cfe-commits mailing list