Hi,
Here's a patch for clang-query that adds some refactoring support. It has
no tests and probably has several bugs but I figured it would probably
be better to publish it now rather than let it continue to languish on my
workstation. An example session:
$ cat cqtest.cpp
void g();
void f() {
g();
}
$ clang-query cqtest.cpp
clang-query> rewrite add declRefExpr(to(functionDecl(hasName("g"))))
Rewriter 0 created.
clang-query> rewrite rule 0 add root h
Rewrite rule 0 created.
clang-query> rewrite apply 0
Can't find usable .clang-format, using LLVM style
clang-query> ^D
$ cat cqtest.cpp
void g();
void f() { h(); }
Thanks,
0001-Initial-version-of-clang-query-refactoring-tool.patch (20.9 KB)