[PATCH] New and improved subexpression references implementation.

Edwin Vane edwin.vane at intel.com
Mon May 13 13:11:18 PDT 2013


Hi klimek, doug.gregor, gribozavr,

Sub-expression references implemented without Grafter

Removed Grafter. Builders only maintain parent links. When doing a
search through the tree of bound nodes BoundNodesTree::visitMatches()
isn't used. Instead, a search is conducted upwards from the current
builder-under-construction toward the root. An iterator class
encapsulates the logic. The search order implemented by the iterator was
not chosen for any particular reason as the search order isn't important
for existing matchers.

Also, this new implementation searches beyond the first node that
matches by name and type and keeps looking until a node matches on the
equalsBoundNode() identity condition if possible.

Disabled the test that specifically ensured the aforementioned "keep
searching" algorithm wasn't employed.

Commenting of code and updates to equalsBoundNode matcher tests will
come after high level review of search logic is reviewed.

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

Files:
  include/clang/ASTMatchers/ASTMatchers.h
  include/clang/ASTMatchers/ASTMatchersInternal.h
  lib/ASTMatchers/ASTMatchFinder.cpp
  lib/ASTMatchers/ASTMatchersInternal.cpp
  unittests/ASTMatchers/ASTMatchersTest.cpp
  unittests/ASTMatchers/BoundNodesIteratorTest.cpp
  unittests/ASTMatchers/CMakeLists.txt
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D788.1.patch
Type: text/x-patch
Size: 26716 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130513/70bf2ed8/attachment.bin>


More information about the cfe-commits mailing list