[clang] [Feat] Allow Finding across only parts of an AST. (PR #127423)

2025-02-27 Thread Michael Spencer via cfe-commits
https://github.com/Bigcheese approved this pull request. I think this is good from the modules end and I get how the predicate can be useful. My only concern is that this feels a bit like another matcher that's not using the matcher API, so I'd like someone more familiar with it to also approv

[clang] [Feat] Allow Finding across only parts of an AST. (PR #127423)

2025-02-27 Thread via cfe-commits
matts1 wrote: It's a general performance optimization. For example, you could write a predicate to check whether it's in the std namespace to avoid checking the standard library, or a predicate to check whether a class is a subclass of `proto.Message` to skip generated protobuf code. https://

[clang] [Feat] Allow Finding across only parts of an AST. (PR #127423)

2025-02-27 Thread Michael Spencer via cfe-commits
Bigcheese wrote: Is there a particular reason to have this be a generic predicate rather than just a bool of if other modules should be visited? I can see how you could do other things with it like skipping a namespace or something, but I'm not sure if the other use cases would actually see us

[clang] [Feat] Allow Finding across only parts of an AST. (PR #127423)

2025-02-20 Thread via cfe-commits
matts1 wrote: > I'm not a modules or matcher expert, but this doesn't match my (perhaps > uninformed) understanding. I thought that when we import a module, it _is_ > part of our TU, similarly to when we include a header. You are correct. I phrased it very poorly. I'll reclarify - if we have a

[clang] [Feat] Allow Finding across only parts of an AST. (PR #127423)

2025-02-20 Thread Hans Wennborg via cfe-commits
zmodem wrote: > This is relevant for clang modules, as they are imported into the AST, but > are actually part of a different TU. I'm not a modules or matcher expert, but this doesn't match my (perhaps uninformed) understanding. I thought that when we import a module, it *is* part of our TU,

[clang] [Feat] Allow Finding across only parts of an AST. (PR #127423)

2025-02-16 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Matt (matts1) Changes This is relevant for clang modules, as they are imported into the AST, but are actually part of a different TU. It can result in hundreds of milliseconds of additional time to also traverse the AST of these modules,

[clang] [Feat] Allow Finding across only parts of an AST. (PR #127423)

2025-02-16 Thread via cfe-commits
https://github.com/matts1 ready_for_review https://github.com/llvm/llvm-project/pull/127423 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Feat] Allow Finding across only parts of an AST. (PR #127423)

2025-02-16 Thread via cfe-commits
https://github.com/matts1 edited https://github.com/llvm/llvm-project/pull/127423 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Feat] Allow Finding across only parts of an AST. (PR #127423)

2025-02-16 Thread via cfe-commits
https://github.com/matts1 edited https://github.com/llvm/llvm-project/pull/127423 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Feat] Allow Finding across only parts of an AST. (PR #127423)

2025-02-16 Thread via cfe-commits
https://github.com/matts1 updated https://github.com/llvm/llvm-project/pull/127423 >From b3d8ac7a2e02a743a52370c5c86be5f8b00d5c8f Mon Sep 17 00:00:00 2001 From: Matt Stark Date: Mon, 17 Feb 2025 12:18:12 +1100 Subject: [PATCH] [Feat] Allow Finding across only parts of an AST. This is relevant

[clang] [Feat] Allow Finding across only parts of an AST. (PR #127423)

2025-02-16 Thread via cfe-commits
github-actions[bot] wrote: Thank you for submitting a Pull Request (PR) to the LLVM Project! This PR will be automatically labeled and the relevant teams will be notified. If you wish to, you can add reviewers by using the "Reviewers" section on this page. If this is not working for you, it

[clang] [Feat] Allow Finding across only parts of an AST. (PR #127423)

2025-02-16 Thread via cfe-commits
https://github.com/matts1 created https://github.com/llvm/llvm-project/pull/127423 This is relevant for clang modules, as they are imported into the AST, but are actually part of a different TU. It can result in hundreds of milliseconds of additional time to also traverse the AST of these modu