From abdc13a08af81d2f6f196e4ecee88b0f1c1303c3 Mon Sep 17 00:00:00 2001 From: Alexander Kornienko Date: Tue, 15 Jan 2019 15:34:26 +0000 Subject: Reduce ASTMatchers stack footprint. Addresses http://llvm.org/PR38851 The BoundNodesTreeBuilder class is used both directly and indirectly as a local variable in matchesAncestorOfRecursively, memoizedMatchesAncestorOfRecursively and other functions that happen to be on long recursive call paths. By reducing the inline storage size of the SmallVector we dramatically reduce the stack requirements of ASTMatchers. Running clang-tidy with a large number of checks enabled on a few arbitrarily chosen files show no performance regression. llvm-svn: 351196 --- clang/include/clang/ASTMatchers/ASTMatchersInternal.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'clang/include') diff --git a/clang/include/clang/ASTMatchers/ASTMatchersInternal.h b/clang/include/clang/ASTMatchers/ASTMatchersInternal.h index 9d9f867d053a..34851a907e0d 100644 --- a/clang/include/clang/ASTMatchers/ASTMatchersInternal.h +++ b/clang/include/clang/ASTMatchers/ASTMatchersInternal.h @@ -261,7 +261,7 @@ public: } private: - SmallVector Bindings; + SmallVector Bindings; }; class ASTMatchFinder; -- cgit v1.2.3