This is an archive of the discontinued LLVM Phabricator instance.

Introduce a DirectoryEntryRef that stores both a reference and an accessed name to the directory entry
ClosedPublic

Authored by arphaman on Aug 30 2019, 4:00 PM.

Details

Summary

This patch is similar to the FileEntryRef patch, in that it introduces a parallel API to get the directory entry, without replacing all uses. The immediate use in the patch fixes the issue where a file manager was reused in clang-scan-deps, but reported an different file path whenever a framework lookup was done through a symlink.

Diff Detail

Repository
rL LLVM

Event Timeline

arphaman created this revision.Aug 30 2019, 4:00 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 30 2019, 4:00 PM
dexonsmith accepted this revision.Aug 30 2019, 4:11 PM

A few minor comments. Assuming the FIXME I point out was intentionally left for later, this LGTM.

clang/include/clang/Basic/FileManager.h
59 ↗(On Diff #218181)

Should this return const Directory& because it's guaranteed to be valid.

clang/include/clang/Lex/DirectoryLookup.h
68–69 ↗(On Diff #218181)

Since you're modifying this constructor it might be nice to cleanup the comment style (drop the Directory ctor - prefix). Up to you.

clang/lib/Lex/HeaderSearch.cpp
299 ↗(On Diff #218181)

Did you mean to leave this behind for a future commit? Or did you miss fixing this?

This revision is now accepted and ready to land.Aug 30 2019, 4:11 PM
arphaman marked 4 inline comments as done.Aug 30 2019, 6:26 PM
arphaman added inline comments.
clang/lib/Lex/HeaderSearch.cpp
299 ↗(On Diff #218181)

This is for a future commit.

This revision was automatically updated to reflect the committed changes.
arphaman marked an inline comment as done.
Herald added a project: Restricted Project. · View Herald TranscriptAug 30 2019, 6:27 PM