<div dir="ltr">On Thu, Apr 25, 2013 at 9:55 PM, Peeter Joot <span dir="ltr"><<a href="mailto:peeter.joot@gmail.com" target="_blank">peeter.joot@gmail.com</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">The following example:<br><br><a href="http://llvm.org/svn/llvm-project/cfe/branches/tooling/examples/rename-method/RenameMethod.cpp" target="_blank">http://llvm.org/svn/llvm-project/cfe/branches/tooling/examples/rename-method/RenameMethod.cpp</a><br>

<br>doesn't compile with the current clang source.  Hacking it based on samples in tools/clang/unittests/ASTMatchers/ASTMatchersTest.cpp <div><br></div><div><div>--- orig/RenameMethod.cpp       2012-07-02 15:22:34.000000000 -0400</div>

<div>+++ RenameMethod.cpp    2013-04-25 15:50:48.000000000 -0400</div><div>@@ -122,22 +122,22 @@ int main(int argc, const char **argv) {</div><div>   CallRenamer CallCallback(&Tool.getReplacements());</div><div>   Finder.addMatcher(</div>

<div>     // Match calls...</div><div>-    call(</div><div>+    memberCallExpr(</div><div>       // Where the callee is a method called "Get"...</div><div>-      callee(method(hasName("Get"))),</div><div>

+      callee(methodDecl(hasName("Get"))),</div><div>       // ... and the class on which the method is called is derived</div><div>       // from ElementsBase ...</div><div>-      thisPointerType(record(</div>
<div>
+      thisPointerType(recordDecl(</div><div>         isDerivedFrom("ElementsBase"))),</div><div>       // ... and bind the member expression to the ID "member", under which</div><div>       // it can later be found in the callback.</div>

<div>-      callee(id("member", memberExpression()))),</div><div>+      callee(id("member", memberExpr()))),</div><div>     &CallCallback);</div><div><br></div><div>   DeclRenamer DeclCallback(&Tool.getReplacements());</div>

<div>   Finder.addMatcher(</div><div>     // Match declarations...</div><div>-    id("method", method(hasName("Get"),</div><div>+    id("method", methodDecl(hasName("Get"),</div><div>

                         ofClass(isDerivedFrom("ElementsBase")))),</div><div>     &DeclCallback);</div><div><br></div><div>appears to be enough to make it compile.</div></div></div></blockquote><div><br></div>
<div style>The tooling/ branch is currently unsupported. We're planning to start a better rename tool into the extra/tools repo in the upcoming months...</div><div style><br></div><div style>Cheers,</div><div style>/Manuel</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><span class="HOEnZb"><font color="#888888"><div><div><br></div>-- <br>Peeter
</div></font></span></div></div>
<br>_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@cs.uiuc.edu">cfe-dev@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a><br>
<br></blockquote></div><br></div></div>