diff options
author | Mads Ravn <madsravn@gmail.com> | 2016-12-30 20:49:44 +0000 |
---|---|---|
committer | Mads Ravn <madsravn@gmail.com> | 2016-12-30 20:49:44 +0000 |
commit | 8ab17a30a2316c0ecc09341382fdc6959aa42418 (patch) | |
tree | abf3984fa2a2408c9d65a8dc1110eddb4f185c5c /clang/docs/LibASTMatchersTutorial.rst | |
parent | de9f00eecd5bede57013f47e34281f963b592450 (diff) | |
download | bcm5719-llvm-8ab17a30a2316c0ecc09341382fdc6959aa42418.tar.gz bcm5719-llvm-8ab17a30a2316c0ecc09341382fdc6959aa42418.zip |
[clang] Minor fix to libASTMatcherTutorial
There was a small error in the code in the tutorial. The tutorial contains a few errors which results in code not being able to compile.
One error was described here: https://llvm.org/bugs/show_bug.cgi?id=25583 .
I found and fixed the error and one additional error.
Reviewers: aaron.ballman, malcolm.parsons
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D28180
llvm-svn: 290766
Diffstat (limited to 'clang/docs/LibASTMatchersTutorial.rst')
-rw-r--r-- | clang/docs/LibASTMatchersTutorial.rst | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/docs/LibASTMatchersTutorial.rst b/clang/docs/LibASTMatchersTutorial.rst index 603b2faf01d..baf2c1c3e69 100644 --- a/clang/docs/LibASTMatchersTutorial.rst +++ b/clang/docs/LibASTMatchersTutorial.rst @@ -496,9 +496,9 @@ And change ``LoopPrinter::run`` to void LoopPrinter::run(const MatchFinder::MatchResult &Result) { ASTContext *Context = Result.Context; - const ForStmt *FS = Result.Nodes.getStmtAs<ForStmt>("forLoop"); + const ForStmt *FS = Result.Nodes.getNodeAs<ForStmt>("forLoop"); // We do not want to convert header files! - if (!FS || !Context->getSourceManager().isFromMainFile(FS->getForLoc())) + if (!FS || !Context->getSourceManager().isWrittenInMainFile(FS->getForLoc())) return; const VarDecl *IncVar = Result.Nodes.getNodeAs<VarDecl>("incVarName"); const VarDecl *CondVar = Result.Nodes.getNodeAs<VarDecl>("condVarName"); |