[PATCH] D29622: Add a batch query and replace tool based on AST matchers.

2017-04-05 Thread Julian Bangert via Phabricator via cfe-commits
jbangert updated this revision to Diff 94297. jbangert added a comment. Fix command line tool. https://reviews.llvm.org/D29622 Files: clang-query/CMakeLists.txt clang-query/QueryReplace.cpp clang-query/QueryReplace.h clang-query/replace-tool/CMakeLists.txt clang-query/replace-tool/Cla

[PATCH] D29622: Add a batch query and replace tool based on AST matchers.

2017-02-07 Thread Julian Bangert via Phabricator via cfe-commits
jbangert added a comment. Thank you for the feedback, addressed and reformatted using llvm style. Comment at: clang-query/QueryReplace.h:35-36 + + /// \brief Replacement text. %"identifier" will be substituted by the text of + /// an identifier. + std::string ToTemplate; ---

[PATCH] D29622: Add a batch query and replace tool based on AST matchers.

2017-02-07 Thread Julian Bangert via Phabricator via cfe-commits
jbangert updated this revision to Diff 87580. jbangert marked 7 inline comments as done. jbangert added a comment. Response to initial code review. https://reviews.llvm.org/D29622 Files: clang-query/CMakeLists.txt clang-query/QueryReplace.cpp clang-query/QueryReplace.h clang-query/repla

[PATCH] D29622: Add a batch query and replace tool based on AST matchers.

2017-02-07 Thread Samuel Benzaquen via Phabricator via cfe-commits
sbenza added inline comments. Comment at: clang-query/QueryReplace.h:35-36 + + /// \brief Replacement text. %"identifier" will be substituted by the text of + /// an identifier. + std::string ToTemplate; klimek wrote: > This doesn't seem to come up in the test

[PATCH] D29622: Add a batch query and replace tool based on AST matchers.

2017-02-07 Thread Eric Liu via Phabricator via cfe-commits
ioeric added inline comments. Comment at: clang-query/QueryReplace.cpp:1 +#include "QueryReplace.h" +#include "QueryParser.h" Please add license header. Comment at: clang-query/QueryReplace.cpp:37 + +llvm::ErrorOr QueryReplaceSpec::parseFromJSO

[PATCH] D29622: Add a batch query and replace tool based on AST matchers.

2017-02-07 Thread Manuel Klimek via Phabricator via cfe-commits
klimek added inline comments. Comment at: clang-query/QueryReplace.cpp:50 + +void QueryReplaceTool::addOperation(clang::query::QueryReplaceSpec &Spec) { + ast_matchers::dynamic::Diagnostics Diag; Shouldn't that also just return the error? Comm

[PATCH] D29622: Add a batch query and replace tool based on AST matchers.

2017-02-07 Thread Julian Bangert via Phabricator via cfe-commits
jbangert created this revision. Herald added a subscriber: mgorny. This requires https://reviews.llvm.org/D29613. It adds a new tool, clang-query-replace that replaces and AST node with the result of evaluating a simple template language. https://reviews.llvm.org/D29622 Files: clang-query/C