This is an archive of the discontinued LLVM Phabricator instance.

Support: Remove duplicated code in {File,clang::ModulesDependency}Collector, NFC
ClosedPublic

Authored by dexonsmith on Jan 22 2021, 5:28 PM.

Details

Summary

Refactor the duplicated canonicalize-path logic in FileCollector and
ModulesDependencyCollector into a new utility called
PathCanonicalizer that's shared. This popped up when tracking down a
bug common to both in https://reviews.llvm.org/D95202.

As drive-bys, update a few names and comments to better reflect the
effect of the code, delay removal of ..s to avoid an unnecessary extra
string copy, and leave behind a couple of FIXMEs for future
consideration.

Diff Detail

Event Timeline

dexonsmith created this revision.Jan 22 2021, 5:28 PM
dexonsmith requested review of this revision.Jan 22 2021, 5:28 PM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptJan 22 2021, 5:28 PM
JDevlieghere accepted this revision.Jan 22 2021, 7:03 PM

LGTM, thanks for cleaning this up!

This revision is now accepted and ready to land.Jan 22 2021, 7:03 PM
This revision was landed with ongoing or failed builds.Jan 25 2021, 3:09 PM
This revision was automatically updated to reflect the committed changes.