diff options
author | Alexander Kornienko <alexfh@google.com> | 2019-01-15 15:34:26 +0000 |
---|---|---|
committer | Alexander Kornienko <alexfh@google.com> | 2019-01-15 15:34:26 +0000 |
commit | 05b6df6fd16d880ca64546631db928ba9df73617 (patch) | |
tree | e9b9963e125b03b86fcbaebe29e6da9962986036 /clang | |
parent | d0e0e3b3b40850016759a7ecd336745f2f615a83 (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.
Diffstat (limited to 'clang')
-rw-r--r-- | clang/include/clang/ASTMatchers/ASTMatchersInternal.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/include/clang/ASTMatchers/ASTMatchersInternal.h b/clang/include/clang/ASTMatchers/ASTMatchersInternal.h index 9d9f867d053..34851a907e0 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; |