summaryrefslogtreecommitdiffstats
path: root/clang/docs/LibASTMatchersTutorial.rst
diff options
context:
space:
mode:
authorEdwin Vane <edwin.vane@intel.com>2013-03-05 18:04:37 +0000
committerEdwin Vane <edwin.vane@intel.com>2013-03-05 18:04:37 +0000
commiteec9a93262d16b91078000c8ef4d0a719f93252f (patch)
tree7bb0b066cd6c7e5f72df25aae18063198569953d /clang/docs/LibASTMatchersTutorial.rst
parent3041286f64b0cf5a9e890af6dbec91d7c8c5807f (diff)
downloadbcm5719-llvm-eec9a93262d16b91078000c8ef4d0a719f93252f.tar.gz
bcm5719-llvm-eec9a93262d16b91078000c8ef4d0a719f93252f.zip
Make LibASTMatchersTutorial code match text
Fixed code to match text. Slight adjustment for readability. Author: Béatrice Creusillet llvm-svn: 176493
Diffstat (limited to 'clang/docs/LibASTMatchersTutorial.rst')
-rw-r--r--clang/docs/LibASTMatchersTutorial.rst10
1 files changed, 5 insertions, 5 deletions
diff --git a/clang/docs/LibASTMatchersTutorial.rst b/clang/docs/LibASTMatchersTutorial.rst
index 6ebb4996975..ba568e3594e 100644
--- a/clang/docs/LibASTMatchersTutorial.rst
+++ b/clang/docs/LibASTMatchersTutorial.rst
@@ -395,8 +395,8 @@ variable, and that the right-hand side has integer type.
hasCondition(binaryOperator(
hasOperatorName("<"),
- hasRHS(expr(hasType(isInteger()))),
- hasLHS(declRefExpr(to(varDecl(hasType(isInteger())))))))
+ hasLHS(declRefExpr(to(varDecl(hasType(isInteger()))))),
+ hasRHS(expr(hasType(isInteger())))))
Why? Because it doesn't work. Of the three loops provided in
``test-files/simple.cpp``, zero of them have a matching condition. A
@@ -432,9 +432,9 @@ Adjusting the condition operator will restore the desired match.
hasCondition(binaryOperator(
hasOperatorName("<"),
- hasLHS(expr(hasType(isInteger()))),
- hasRHS(ignoringParenImpCasts(declRefExpr(
- to(varDecl(hasType(isInteger()))))))))
+ hasLHS(ignoringParenImpCasts(declRefExpr(
+ to(varDecl(hasType(isInteger())))))),
+ hasRHS(expr(hasType(isInteger())))))
After adding binds to the expressions we wished to capture and
extracting the identifier strings into variables, we have array-step-2
OpenPOWER on IntegriCloud