This is an archive of the discontinued LLVM Phabricator instance.

[Tooling/DependencyScanning] Make skipping excluded PP ranges during dependency scanning the default
ClosedPublic

Authored by akyrtzi on Apr 27 2022, 2:38 PM.

Details

Summary

This is to improve maintenance a bit and remove need to maintain the additional option and related code-paths.

Diff Detail

Event Timeline

akyrtzi created this revision.Apr 27 2022, 2:38 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 27 2022, 2:38 PM
akyrtzi requested review of this revision.Apr 27 2022, 2:38 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 27 2022, 2:38 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript

LGTM in general, with some suggestions in-line. Besides those, I think we should be able to remove PPSkipMappings from the condition in MinimizedVFSFile::create (DependencyScanningFilesystem.cpp).

clang/lib/Tooling/DependencyScanning/DependencyScanningWorker.cpp
206–207

I think we can remove this check as well now.

289–290

Do we need to keep this on the heap?

jansvoboda11 accepted this revision.Apr 28 2022, 2:26 AM
This revision is now accepted and ready to land.Apr 28 2022, 2:26 AM
akyrtzi updated this revision to Diff 425833.Apr 28 2022, 10:27 AM

Change APIs to accept a reference of ExcludedPreprocessorDirectiveSkipMapping instead of a pointer, since it is required now.

@jansvoboda11 thanks for reviewing! I've changed APIs to use a reference instead of a pointer and removed the unnecessary check and heap allocations.

jansvoboda11 accepted this revision.Apr 28 2022, 10:55 AM

Looks good, thanks!