This is an archive of the discontinued LLVM Phabricator instance.

[clang][deps] NFC: Pass around the whole scanning service
AcceptedPublic

Authored by jansvoboda11 on May 10 2023, 3:21 PM.

Details

Summary

Adding new field into the scanning service and propagating it down into the worker, action or collector requires a lot of boilerplate and causes conflicts in our downstream repo. Fix this by passing around the whole service object.

Diff Detail

Event Timeline

jansvoboda11 created this revision.May 10 2023, 3:21 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 10 2023, 3:21 PM
Herald added a subscriber: ributzka. · View Herald Transcript
jansvoboda11 requested review of this revision.May 10 2023, 3:21 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 10 2023, 3:21 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript
benlangmuir added inline comments.May 10 2023, 3:44 PM
clang/include/clang/Tooling/DependencyScanning/DependencyScanningService.h
69

Why drop const?

clang/include/clang/Tooling/DependencyScanning/ModuleDepCollector.h
19

Forward declaration for the header file should be enough

jansvoboda11 added inline comments.May 11 2023, 10:08 AM
clang/include/clang/Tooling/DependencyScanning/DependencyScanningService.h
69

I don't think it adds much, since the members are private and only ever accessed in functions already marked const. I'm fine with keeping the const here if you think there's value in it.

benlangmuir added inline comments.May 11 2023, 10:14 AM
clang/include/clang/Tooling/DependencyScanning/DependencyScanningService.h
69

It's fine, just wanted to check I didn't misunderstand this.

Any other feedback?

clang/include/clang/Tooling/DependencyScanning/ModuleDepCollector.h
19

Good point, I'll do that before committing.

benlangmuir accepted this revision.May 30 2023, 2:47 PM
This revision is now accepted and ready to land.May 30 2023, 2:47 PM