[cfe-commits] [clang-tools-extra] r162539 - /clang-tools-extra/trunk/remove-cstr-calls/RemoveCStrCalls.cpp
Daniel Jasper
djasper at google.com
Thu Aug 23 22:39:51 PDT 2012
Author: djasper
Date: Fri Aug 24 00:39:51 2012
New Revision: 162539
URL: http://llvm.org/viewvc/llvm-project?rev=162539&view=rev
Log:
Change AST matcher names to conform with the new naming.
Modified:
clang-tools-extra/trunk/remove-cstr-calls/RemoveCStrCalls.cpp
Modified: clang-tools-extra/trunk/remove-cstr-calls/RemoveCStrCalls.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/remove-cstr-calls/RemoveCStrCalls.cpp?rev=162539&r1=162538&r2=162539&view=diff
==============================================================================
--- clang-tools-extra/trunk/remove-cstr-calls/RemoveCStrCalls.cpp (original)
+++ clang-tools-extra/trunk/remove-cstr-calls/RemoveCStrCalls.cpp Fri Aug 24 00:39:51 2012
@@ -191,8 +191,8 @@
ast_matchers::MatchFinder Finder;
FixCStrCall Callback(&Tool.getReplacements());
Finder.addMatcher(
- constructorCall(
- hasDeclaration(method(hasName(StringConstructor))),
+ constructExpr(
+ hasDeclaration(methodDecl(hasName(StringConstructor))),
argumentCountIs(2),
// The first argument must have the form x.c_str() or p->c_str()
// where the method is string::c_str(). We can use the copy
@@ -200,23 +200,23 @@
// the string object).
hasArgument(
0,
- id("call", memberCall(
- callee(id("member", memberExpression())),
- callee(method(hasName(StringCStrMethod))),
- on(id("arg", expression()))))),
+ id("call", memberCallExpr(
+ callee(id("member", memberExpr())),
+ callee(methodDecl(hasName(StringCStrMethod))),
+ on(id("arg", expr()))))),
// The second argument is the alloc object which must not be
// present explicitly.
hasArgument(
1,
- defaultArgument())),
+ defaultArgExpr())),
&Callback);
Finder.addMatcher(
- constructorCall(
+ constructExpr(
// Implicit constructors of these classes are overloaded
// wrt. string types and they internally make a StringRef
// referring to the argument. Passing a string directly to
// them is preferred to passing a char pointer.
- hasDeclaration(method(anyOf(
+ hasDeclaration(methodDecl(anyOf(
hasName("::llvm::StringRef::StringRef"),
hasName("::llvm::Twine::Twine")))),
argumentCountIs(1),
@@ -227,10 +227,10 @@
// directly.
hasArgument(
0,
- id("call", memberCall(
- callee(id("member", memberExpression())),
- callee(method(hasName(StringCStrMethod))),
- on(id("arg", expression())))))),
+ id("call", memberCallExpr(
+ callee(id("member", memberExpr())),
+ callee(methodDecl(hasName(StringCStrMethod))),
+ on(id("arg", expr())))))),
&Callback);
return Tool.run(newFrontendActionFactory(&Finder));
}
More information about the cfe-commits
mailing list