This is an archive of the discontinued LLVM Phabricator instance.

[clang][deps] Make the C++ API more type-safe
ClosedPublic

Authored by jansvoboda11 on Jul 27 2023, 2:45 PM.

Details

Summary

Scanner's C++ API accepts a set of modular dependencies the client has already seen and for which it doesn't need the full details. This is currently a set of strings, which somewhat implies that it should contain the set of module names. However, scanner internally expects the values to be in the format "{hash}{name}". Besides not being documented, this is very unintuitive. This patch makes this expectation explicit by changing the type to set of ModuleID.

Diff Detail

Event Timeline

jansvoboda11 created this revision.Jul 27 2023, 2:45 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 27 2023, 2:45 PM
Herald added a subscriber: ributzka. · View Herald Transcript
jansvoboda11 requested review of this revision.Jul 27 2023, 2:45 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 27 2023, 2:45 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript
jansvoboda11 edited the summary of this revision. (Show Details)Jul 27 2023, 2:49 PM
jansvoboda11 edited the summary of this revision. (Show Details)Jul 28 2023, 11:18 AM
jansvoboda11 added a reviewer: benlangmuir.
benlangmuir accepted this revision.Jul 28 2023, 11:21 AM
benlangmuir added inline comments.
clang/include/clang/Tooling/DependencyScanning/DependencyScanningTool.h
174–175

You can drop the third template argument; it now matches the default.

This revision is now accepted and ready to land.Jul 28 2023, 11:21 AM
This revision was landed with ongoing or failed builds.Jul 28 2023, 12:04 PM
This revision was automatically updated to reflect the committed changes.