aboutsummaryrefslogtreecommitdiff
path: root/clang/include
diff options
context:
space:
mode:
authorAlexander Kornienko <alexfh@google.com>2019-01-15 15:34:26 +0000
committerAlexander Kornienko <alexfh@google.com>2019-01-15 15:34:26 +0000
commitabdc13a08af81d2f6f196e4ecee88b0f1c1303c3 (patch)
tree9a3f65a6e96daa91396f5990d582a368fa11d51f /clang/include
parent199a00c3a2cba968b880eb662d746bcb8ba1c963 (diff)
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
Diffstat (limited to 'clang/include')
-rw-r--r--clang/include/clang/ASTMatchers/ASTMatchersInternal.h2
1 files changed, 1 insertions, 1 deletions
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<BoundNodesMap, 16> Bindings;
+ SmallVector<BoundNodesMap, 1> Bindings;
};
class ASTMatchFinder;