[PATCH] D80202: [ASTMatchers] Performance optimization for memoization

Manuel Klimek via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jun 22 08:35:16 PDT 2020


klimek added a reviewer: sammccall.
klimek added a comment.

+Sam for additional sanity checking.



================
Comment at: clang/lib/ASTMatchers/ASTMatchFinder.cpp:902
   // Maps (matcher, node) -> the match result for memoization.
-  typedef std::map<MatchKey, MemoizedMatchResult> MemoizationMap;
+  typedef std::map<MatchKey, MemoizedMatchResult, std::less<>> MemoizationMap;
   MemoizationMap ResultCache;
----------------
Ok, if this actually matters, we should also not use a std::map here, but a llvm::DenseMap (or do we rely on iteration invalidation semantics here?).


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D80202/new/

https://reviews.llvm.org/D80202





More information about the cfe-commits mailing list