From 141f1d24d5aa139ebb91f7ad0252e97a25895fa4 Mon Sep 17 00:00:00 2001 From: Manuel Klimek Date: Wed, 17 Apr 2013 15:02:12 +0000 Subject: This corrects problems in the LibASTMatchers tutorial. Patch by Jochen Eisinger. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179683 91177308-0d34-0410-b5e6-96231b3b80d8 --- docs/LibASTMatchersTutorial.rst | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'docs') diff --git a/docs/LibASTMatchersTutorial.rst b/docs/LibASTMatchersTutorial.rst index ba568e3594..66071c1696 100644 --- a/docs/LibASTMatchersTutorial.rst +++ b/docs/LibASTMatchersTutorial.rst @@ -27,6 +27,8 @@ guide `_. git clone http://llvm.org/git/llvm.git cd llvm/tools git clone http://llvm.org/git/clang.git + cd clang/tools + git clone http://llvm.org/git/clang-tools-extra.git extra Next you need to obtain the CMake build system and Ninja build tool. You may already have CMake installed, but current binary versions of CMake @@ -163,7 +165,7 @@ You should now be able to run the syntax checker, which is located in .. code-block:: console - cat "void main() {}" > test.cpp + cat "int main() { return 0; }" > test.cpp bin/loop-convert test.cpp -- Note the two dashes after we specify the source file. The additional @@ -275,8 +277,9 @@ Add the following to ``LoopConvert.cpp``: class LoopPrinter : public MatchFinder::MatchCallback { public : virtual void run(const MatchFinder::MatchResult &Result) { - if (const ForStmt *FS = Result.Nodes.getNodeAs("forLoop")) - FS->dump(); + if (const ForStmt *FS = Result.Nodes.getNodeAs("forLoop")) + FS->dump(); + } }; And change ``main()`` to: -- cgit v1.2.3-18-g5258