This is an archive of the discontinued LLVM Phabricator instance.

[Index] Added a ShouldSkipFunctionBody callback to libIndex, and refactored clients to use it instead of inventing their own solution
ClosedPublic

Authored by gribozavr on Aug 28 2019, 6:35 AM.

Diff Detail

Repository
rL LLVM

Event Timeline

gribozavr created this revision.Aug 28 2019, 6:35 AM
jkorous added inline comments.Aug 28 2019, 10:34 AM
clang/include/clang/Index/IndexingAction.h
60 ↗(On Diff #217627)

Why not use default argument instead of overloading?

Otherwise LGTM. Thanks for refactoring this!

jkorous accepted this revision.Aug 28 2019, 10:45 AM
This revision is now accepted and ready to land.Aug 28 2019, 10:45 AM
gribozavr added inline comments.Aug 28 2019, 11:48 AM
clang/include/clang/Index/IndexingAction.h
60 ↗(On Diff #217627)

Writing a whole lambda in a default argument seemed to be a bit too much. I can change to a default argument if you think it is better. WDYT?

jkorous added inline comments.Aug 28 2019, 12:24 PM
clang/include/clang/Index/IndexingAction.h
60 ↗(On Diff #217627)

Seems like we do that in couple places (VisibleModuleSet::setVisible or FinishTemplateArgumentDeduction). Anyway, it's no big deal, I'm fine with either.

This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptAug 29 2019, 4:46 AM
MaskRay added inline comments.
cfe/trunk/include/clang/Index/IndexingAction.h
58

I know ShouldSkipFunctionBody is important for multi-threaded indexing, but why is it a mandatory argument?

There are lots of other overloads, are they good candidates for being mandatory arguments?