[all-commits] [llvm/llvm-project] cba56e: [ASTMatcher] Correct memoization bug ignoring dire...

Loïc Joly via All-commits all-commits at lists.llvm.org
Mon Jun 22 03:56:49 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: cba56e026c7beb91a2716276151c5b4360032834
      https://github.com/llvm/llvm-project/commit/cba56e026c7beb91a2716276151c5b4360032834
  Author: Loïc Joly <loic.joly at sonarsource.com>
  Date:   2020-06-22 (Mon, 22 Jun 2020)

  Changed paths:
    M clang/lib/ASTMatchers/ASTMatchFinder.cpp
    M clang/unittests/ASTMatchers/ASTMatchersTraversalTest.cpp

  Log Message:
  -----------
  [ASTMatcher] Correct memoization bug ignoring direction (descendants or ancestors)

Summary:
In ASTMatcher, when we have `has(...)` and `hasParent(...)` called with the same internal matcher on the same node, the memoization process will mix-up the two calls because the direction of the traversal is not part of the memoization key.

This patch adds this information.

Reviewers: klimek

Reviewed By: klimek

Subscribers: Godin, njames93, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D80025




More information about the All-commits mailing list