]> granicus.if.org Git - clang/commit
First revision of the dynamic ASTMatcher library.
authorManuel Klimek <klimek@google.com>
Tue, 14 May 2013 09:13:00 +0000 (09:13 +0000)
committerManuel Klimek <klimek@google.com>
Tue, 14 May 2013 09:13:00 +0000 (09:13 +0000)
commitf7f295f321fd434e1e542844a71f538a56f2f8fb
treec3e925ae9be703e23135e799dc29777b3ca77be8
parent2a9805d227375efd988522873d4edc282010baae
First revision of the dynamic ASTMatcher library.

This library supports all the features of the compile-time based ASTMatcher
library, but allows the user to specify and construct the matchers at runtime.
It contains the following modules:
 - A variant type, to be used by the matcher factory.
 - A registry, where the matchers are indexed by name and have a factory method
   with a generic signature.
 - A simple matcher expression parser, that can be used to convert a matcher
   expression string into actual matchers that can be used with the AST at
   runtime.

Many features where omitted from this first revision to simplify this code
review. The main ideas are still represented in this change and it already has
support working use cases.
Things that are missing:
 - Support for polymorphic matchers. These requires supporting code in the
   registry, the marshallers and the variant type.
 - Support for numbers, char and bool arguments to the matchers. This requires
   supporting code in the parser and the variant type.
 - A command line program putting everything together and providing an already
   functional tool.

Patch by Samuel Benzaquen.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181768 91177308-0d34-0410-b5e6-96231b3b80d8
24 files changed:
include/clang/ASTMatchers/ASTMatchFinder.h
include/clang/ASTMatchers/ASTMatchersInternal.h
include/clang/ASTMatchers/Dynamic/Diagnostics.h [new file with mode: 0644]
include/clang/ASTMatchers/Dynamic/Parser.h [new file with mode: 0644]
include/clang/ASTMatchers/Dynamic/Registry.h [new file with mode: 0644]
include/clang/ASTMatchers/Dynamic/VariantValue.h [new file with mode: 0644]
lib/ASTMatchers/ASTMatchFinder.cpp
lib/ASTMatchers/CMakeLists.txt
lib/ASTMatchers/Dynamic/CMakeLists.txt [new file with mode: 0644]
lib/ASTMatchers/Dynamic/Diagnostics.cpp [new file with mode: 0644]
lib/ASTMatchers/Dynamic/Makefile [new file with mode: 0644]
lib/ASTMatchers/Dynamic/Marshallers.h [new file with mode: 0644]
lib/ASTMatchers/Dynamic/Parser.cpp [new file with mode: 0644]
lib/ASTMatchers/Dynamic/Registry.cpp [new file with mode: 0644]
lib/ASTMatchers/Dynamic/VariantValue.cpp [new file with mode: 0644]
lib/ASTMatchers/Makefile
unittests/ASTMatchers/ASTMatchersTest.h
unittests/ASTMatchers/CMakeLists.txt
unittests/ASTMatchers/Dynamic/CMakeLists.txt [new file with mode: 0644]
unittests/ASTMatchers/Dynamic/Makefile [new file with mode: 0644]
unittests/ASTMatchers/Dynamic/ParserTest.cpp [new file with mode: 0644]
unittests/ASTMatchers/Dynamic/RegistryTest.cpp [new file with mode: 0644]
unittests/ASTMatchers/Dynamic/VariantValueTest.cpp [new file with mode: 0644]
unittests/ASTMatchers/Makefile