[PATCH] First revision of the dynamic ASTMatcher library

Samuel Benzaquen sbenza at google.com
Wed May 8 08:21:14 PDT 2013


  This diff fixes the ASTMatchers tests broken by this CL.
  The problem is that adding an overload ASTMatchFinder::addMatcher(const DynTypedMatcher&) is changing the behavior of certain expressions.
  In particular, any Matcher<Type> was being implicitly converted to Matcher<QualType> on the addMatcher() call to match one of the overloads.
  After I added the overload with the interface, that one is a better match than the one that performs the conversion so no conversion is done.
  However, the code was trying to match with a QualType and the underlying Matcher<Type> did not match.

  I changed the logic on DynTypedNode to return a Type* even when the stored value is a QualType. This fixes the issue by allowing a Matcher<Type> match a QualType dyn node.

Hi doug.gregor, klimek,

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

CHANGE SINCE LAST DIFF
  http://llvm-reviews.chandlerc.com/D714?vs=1845&id=1887#toc

BRANCH
  svn

ARCANIST PROJECT
  clang

Files:
  unittests/ASTMatchers/Dynamic
  unittests/ASTMatchers/Dynamic/RegistryTest.cpp
  unittests/ASTMatchers/Dynamic/Makefile
  unittests/ASTMatchers/Dynamic/CMakeLists.txt
  unittests/ASTMatchers/Dynamic/ParserTest.cpp
  unittests/ASTMatchers/Dynamic/VariantValueTest.cpp
  unittests/ASTMatchers/CMakeLists.txt
  unittests/ASTMatchers/Makefile
  unittests/ASTMatchers/ASTMatchersTest.cpp
  lib/ASTMatchers/ASTMatchFinder.cpp
  lib/ASTMatchers/CMakeLists.txt
  lib/ASTMatchers/Makefile
  lib/ASTMatchers/Dynamic
  lib/ASTMatchers/Dynamic/Diagnostics.cpp
  lib/ASTMatchers/Dynamic/Registry.cpp
  lib/ASTMatchers/Dynamic/Makefile
  lib/ASTMatchers/Dynamic/Parser.cpp
  lib/ASTMatchers/Dynamic/CMakeLists.txt
  lib/ASTMatchers/Dynamic/VariantValue.cpp
  lib/ASTMatchers/Dynamic/Marshallers.h
  include/clang/ASTMatchers/ASTMatchersInternal.h
  include/clang/ASTMatchers/ASTMatchFinder.h
  include/clang/ASTMatchers/Dynamic
  include/clang/ASTMatchers/Dynamic/Registry.h
  include/clang/ASTMatchers/Dynamic/Parser.h
  include/clang/ASTMatchers/Dynamic/VariantValue.h
  include/clang/ASTMatchers/Dynamic/Diagnostics.h
  include/clang/AST/ASTTypeTraits.h
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D714.15.patch
Type: text/x-patch
Size: 69084 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130508/d7eb0cd3/attachment.bin>


More information about the cfe-commits mailing list