[PATCH] Introduce clang-query tool.

Peter Collingbourne peter at pcc.me.uk
Sun Nov 3 22:35:28 PST 2013


Hi klimek,

This tool is for interactive exploration of the Clang AST using AST matchers.
It currently allows the user to enter a matcher at an interactive prompt
and view the resulting bindings as diagnostics, AST pretty prints or AST
dumps. Example session:

$ cat foo.c
void foo(void) {}
$ clang-query foo.c --
clang-query> match functionDecl()

Match #1:

foo.c:1:1: note: "root" binds here
void foo(void) {}
^~~~~~~~~~~~~~~~~
1 match.

http://llvm-reviews.chandlerc.com/D2098

Files:
  CMakeLists.txt
  Makefile
  clang-query/CMakeLists.txt
  clang-query/Makefile
  unittests/Makefile
  clang-query/Query.h
  clang-query/QueryEngine.cpp
  clang-query/QueryEngine.h
  clang-query/QueryParser.cpp
  clang-query/QueryParser.h
  clang-query/tool/CMakeLists.txt
  clang-query/tool/ClangQuery.cpp
  test/CMakeLists.txt
  test/clang-query/function-decl.c
  test/lit.cfg
  test/lit.site.cfg.in
  unittests/CMakeLists.txt
  unittests/clang-query/CMakeLists.txt
  unittests/clang-query/Makefile
  unittests/clang-query/QueryEngineTest.cpp
  unittests/clang-query/QueryParserTest.cpp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D2098.1.patch
Type: text/x-patch
Size: 26620 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20131103/44aca33c/attachment.bin>


More information about the cfe-commits mailing list