diff options
author | Manuel Klimek <klimek@google.com> | 2013-04-17 15:02:12 +0000 |
---|---|---|
committer | Manuel Klimek <klimek@google.com> | 2013-04-17 15:02:12 +0000 |
commit | 21ae2519bb82fdd48ac46f1847ddfba75e6943e6 (patch) | |
tree | 08be6d83d630be684030a4ea7a940c332dd867c0 /clang/docs/LibASTMatchersTutorial.rst | |
parent | 3d0e3ed0b6628d71c46515b684a03a340e817dd6 (diff) | |
download | bcm5719-llvm-21ae2519bb82fdd48ac46f1847ddfba75e6943e6.tar.gz bcm5719-llvm-21ae2519bb82fdd48ac46f1847ddfba75e6943e6.zip |
This corrects problems in the LibASTMatchers tutorial.
Patch by Jochen Eisinger.
llvm-svn: 179683
Diffstat (limited to 'clang/docs/LibASTMatchersTutorial.rst')
-rw-r--r-- | clang/docs/LibASTMatchersTutorial.rst | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/clang/docs/LibASTMatchersTutorial.rst b/clang/docs/LibASTMatchersTutorial.rst index ba568e3594e..66071c16963 100644 --- a/clang/docs/LibASTMatchersTutorial.rst +++ b/clang/docs/LibASTMatchersTutorial.rst @@ -27,6 +27,8 @@ guide <http://llvm.org/docs/GettingStarted.html>`_. 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<clang::ForStmt>("forLoop")) - FS->dump(); + if (const ForStmt *FS = Result.Nodes.getNodeAs<clang::ForStmt>("forLoop")) + FS->dump(); + } }; And change ``main()`` to: |