r179683 - This corrects problems in the LibASTMatchers tutorial.
Manuel Klimek
klimek at google.com
Wed Apr 17 08:02:12 PDT 2013
Author: klimek
Date: Wed Apr 17 10:02:12 2013
New Revision: 179683
URL: http://llvm.org/viewvc/llvm-project?rev=179683&view=rev
Log:
This corrects problems in the LibASTMatchers tutorial.
Patch by Jochen Eisinger.
Modified:
cfe/trunk/docs/LibASTMatchersTutorial.rst
Modified: cfe/trunk/docs/LibASTMatchersTutorial.rst
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/docs/LibASTMatchersTutorial.rst?rev=179683&r1=179682&r2=179683&view=diff
==============================================================================
--- cfe/trunk/docs/LibASTMatchersTutorial.rst (original)
+++ cfe/trunk/docs/LibASTMatchersTutorial.rst Wed Apr 17 10:02:12 2013
@@ -27,6 +27,8 @@ guide <http://llvm.org/docs/GettingStart
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
.. 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:
More information about the cfe-commits
mailing list