r176493 - Make LibASTMatchersTutorial code match text

Edwin Vane edwin.vane at intel.com
Tue Mar 5 10:04:37 PST 2013


Author: revane
Date: Tue Mar  5 12:04:37 2013
New Revision: 176493

URL: http://llvm.org/viewvc/llvm-project?rev=176493&view=rev
Log:
Make LibASTMatchersTutorial code match text

Fixed code to match text. Slight adjustment for readability.

Author: BĂ©atrice Creusillet

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=176493&r1=176492&r2=176493&view=diff
==============================================================================
--- cfe/trunk/docs/LibASTMatchersTutorial.rst (original)
+++ cfe/trunk/docs/LibASTMatchersTutorial.rst Tue Mar  5 12:04:37 2013
@@ -395,8 +395,8 @@ variable, and that the right-hand side h
 
       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 re
 
       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





More information about the cfe-commits mailing list