This is an archive of the discontinued LLVM Phabricator instance.

[DebugInfo] Normalize paths by removing unnecessary dots
Needs ReviewPublic

Authored by phosek on Jan 31 2021, 10:36 PM.

Details

Summary

This was suggested in https://reviews.llvm.org/D87657 as a better
alternative which doesn't require having to guess separators.

Diff Detail

Event Timeline

phosek requested review of this revision.Jan 31 2021, 10:36 PM
phosek created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptJan 31 2021, 10:36 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript
dblaikie added a subscriber: rnk.Feb 1 2021, 9:47 AM

Does this address @rnk's feedback about symlinks? ( https://reviews.llvm.org/D87657#2296028 )

Does this address @rnk's feedback about symlinks? ( https://reviews.llvm.org/D87657#2296028 )

It doesn't, I think if we want to handle that case, we'd need to use sys::fs::real_path rather than sys::path::remove_dots. That should produce correct result but it's more expensive.

While working on coverage mapping, I've noticed that we already use sys::path::remove_dots with remove_dots_dots=true to normalize filenames there. Whichever way we decide on, I think it'd be useful to unify the two.