This is an archive of the discontinued LLVM Phabricator instance.

[ASTMatchers] Add `isDirectInit` matcher.
AbandonedPublic

Authored by courbet on Jan 17 2023, 5:55 AM.

Details

Reviewers
hokein
alexfh
Summary

To match variables that are direct-initialized.

Diff Detail

Event Timeline

courbet created this revision.Jan 17 2023, 5:55 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 17 2023, 5:55 AM
courbet requested review of this revision.Jan 17 2023, 5:55 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 17 2023, 5:55 AM
courbet updated this revision to Diff 489796.Jan 17 2023, 6:10 AM

Regenerate doc

You also need to add the new matcher to Registry.cpp so it's usable from the dynamic matchers, and you should add a release note for the new matcher.

Are you planning to use this matcher in-tree for something? (We don't usually add new matchers until there's a need for them given how expensive AST matchers are on compile times.)

You also need to add the new matcher to Registry.cpp so it's usable from the dynamic matchers, and you should add a release note for the new matcher.

Thanks, will do.

(We don't usually add new matchers until there's a need for them given how expensive AST matchers are on compile times.)

Ah, that's too bad.

Are you planning to use this matcher in-tree for something?

I was going to use it out-of-tree but figured it's a nice thing to have as many matchers as possible available for common use. There's also always the use case of people using clang-query (typically through godbolt).

I can live with the matcher being out-of-tree though, so you decide :)

courbet updated this revision to Diff 491348.Jan 23 2023, 6:41 AM

add matcher to registry and add release note

You also need to add the new matcher to Registry.cpp so it's usable from the dynamic matchers, and you should add a release note for the new matcher.

Thanks, will do.

(We don't usually add new matchers until there's a need for them given how expensive AST matchers are on compile times.)

Ah, that's too bad.

Are you planning to use this matcher in-tree for something?

I was going to use it out-of-tree but figured it's a nice thing to have as many matchers as possible available for common use. There's also always the use case of people using clang-query (typically through godbolt).

I can live with the matcher being out-of-tree though, so you decide :)

I'd say let's leave it off for now -- if we find an in-tree need at some point, we can definitely add it then.

courbet abandoned this revision.Jan 23 2023, 6:45 AM