[PATCH] D135690: [ASTMatchers] Add matcher for functions that are effectively inline

Trass3r via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Oct 13 14:00:01 PDT 2022


Trass3r added a comment.

In D135690#3852362 <https://reviews.llvm.org/D135690#3852362>, @aaron.ballman wrote:

> what's the need for adding this matcher? Do you plan to use it for some in-tree needs? We usually only add new matchers where there's an immediate need for them because of how expensive AST matchers are to compile (and each matcher adds a fair number of template instantiations to the final binary as well, so there's a bit of runtime cost too).

Didn't realize it has a big cost. Looking inside the `AST_MATCHER` and `REGISTER_MATCHER` macros I can't see any unique instantiations, should be memoized?
I created it a while ago for use in a clang-tidy check. Oddly I can't find that code right now.
It might have been for finding inline ctors/dtors: https://github.com/llvm/llvm-project/issues/51577.
https://chromium.googlesource.com/chromium/src/tools/clang/+/refs/heads/main/plugins/FindBadConstructsConsumer.cpp#495


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D135690



More information about the cfe-commits mailing list