Browse Source

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
Richard Smith 11 years ago
parent
commit
2bc825e5e3
2 changed files with 4 additions and 4 deletions
  1. 2 2
      docs/LibASTMatchersTutorial.rst
  2. 2 2
      docs/LibTooling.rst

+ 2 - 2
docs/LibASTMatchersTutorial.rst

@@ -153,7 +153,7 @@ documentation <LibTooling.html>`_.
         CommonOptionsParser OptionsParser(argc, argv, MyToolCategory);
         CommonOptionsParser OptionsParser(argc, argv, MyToolCategory);
         ClangTool Tool(OptionsParser.getCompilations(),
         ClangTool Tool(OptionsParser.getCompilations(),
                        OptionsParser.getSourcePathList());
                        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
 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;
         MatchFinder Finder;
         Finder.addMatcher(LoopMatcher, &Printer);
         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
 Now, you should be able to recompile and run the code to discover for

+ 2 - 2
docs/LibTooling.rst

@@ -99,7 +99,7 @@ our ``FrontendAction`` over some code.  For example, to run the
   // on.  Thus, it takes a FrontendActionFactory as parameter.  To create a
   // on.  Thus, it takes a FrontendActionFactory as parameter.  To create a
   // FrontendActionFactory from a given FrontendAction type, we call
   // FrontendActionFactory from a given FrontendAction type, we call
   // newFrontendActionFactory<clang::SyntaxOnlyAction>().
   // newFrontendActionFactory<clang::SyntaxOnlyAction>().
-  int result = Tool.run(newFrontendActionFactory<clang::SyntaxOnlyAction>());
+  int result = Tool.run(newFrontendActionFactory<clang::SyntaxOnlyAction>().get());
 
 
 Putting it together --- the first tool
 Putting it together --- the first tool
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -136,7 +136,7 @@ version of this example tool is also checked into the clang tree at
     CommonOptionsParser OptionsParser(argc, argv, MyToolCategory);
     CommonOptionsParser OptionsParser(argc, argv, MyToolCategory);
     ClangTool Tool(OptionsParser.getCompilations(),
     ClangTool Tool(OptionsParser.getCompilations(),
                    OptionsParser.getSourcePathList());
                    OptionsParser.getSourcePathList());
-    return Tool.run(newFrontendActionFactory<clang::SyntaxOnlyAction>());
+    return Tool.run(newFrontendActionFactory<clang::SyntaxOnlyAction>().get());
   }
   }
 
 
 Running the tool on some code
 Running the tool on some code