This is an archive of the discontinued LLVM Phabricator instance.

[clangd] Always try to build absolute path
ClosedPublic

Authored by kadircet on Jan 3 2019, 3:42 AM.

Details

Summary

This only changes behavior in cases when the file itself is a symlink.

When canonicalizing paths do not look at tryGetRealPathName, which
contains the resolved path for files that are symlinks. Instead first build the
absolute path even if it contains some symlinks on the path. Then resolve only
the symlinks on the path and leave it as it is if the file itself is a symlink.

Event Timeline

kadircet created this revision.Jan 3 2019, 3:42 AM
ilya-biryukov accepted this revision.Jan 3 2019, 5:45 AM

LGTM
NIT: a typo in the change description: s/smylinks/symlinks

Maybe also add a separate sentence to the description that this should not affect the behavior if file is not a symlink, e.g. something like

This only changes behavior in cases when the file itself is a symlink.

This information is present in the change description, but a little hard to find.

This revision is now accepted and ready to land.Jan 3 2019, 5:45 AM
kadircet edited the summary of this revision. (Show Details)Jan 3 2019, 5:46 AM
This revision was automatically updated to reflect the committed changes.