HomePhabricator

[ASTMatchers] Avoid recursion in ancestor matching to save stack space.

Authored by sammccall on Sep 1 2020, 11:22 AM.

Description

[ASTMatchers] Avoid recursion in ancestor matching to save stack space.

A recent change increased the stack size of memoizedMatchesAncestorOfRecursively
leading to stack overflows on real code involving large fold expressions.
It's not totally unreasonable to choke on very deep ASTs, but as common
infrastructure it's be nice if ASTMatchFinder is more robust.
(It already uses data recursion for the regular "downward" traversal.)

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

Details

Committed
sammccallSep 22 2020, 10:43 AM
Differential Revision
D86964: [ASTMatchers] Avoid recursion in ancestor matching to save stack space.
Parents
rGc3c08bfdfd62: [SyntaxTree] Test the List API
Branches
Unknown
Tags
Unknown