This is an archive of the discontinued LLVM Phabricator instance.

Module: Use FileEntryRef and DirectoryEntryRef in Umbrella, Header, and DirectoryName, NFC
Changes PlannedPublic

Authored by dexonsmith on Oct 30 2020, 2:07 PM.

Details

Summary

Push FileEntryRef and DirectoryEntryRef further, using it them
Module::Umbrella, Module::Header::Entry, and
Module::DirectoryName::Entry.

  • Add DirectoryEntryRef::operator const DirectoryEntry * and OptionalDirectoryEntryRefDegradesToDirectoryEntryPtr, to get the same "degrades to DirectoryEntry* behaviour FileEntryRef enjoys (this avoids a bunch of churn in various clang tools).
  • Fix the DirectoryEntryRef constructor from MapEntry to take it by const&.

Note that we cannot get rid of the ...AsWritten names leveraging the
new classes, since these need to be as written in the ModuleMap file
and the module directory path is preprended for the lookup in the
FileManager.

Diff Detail

Event Timeline

dexonsmith created this revision.Oct 30 2020, 2:07 PM
dexonsmith requested review of this revision.Oct 30 2020, 2:07 PM
dexonsmith edited the summary of this revision. (Show Details)

Removed the FIXMEs about the ...AsWritten fields, as I just took a deeper look and we need them. The headers/etc. are looked up in the FileManager with the module directory prepended, and these ...AsWritten fields are without that.

This revision is now accepted and ready to land.Nov 30 2020, 8:48 AM
Herald added a project: Restricted Project. · View Herald TranscriptDec 2 2020, 2:07 PM
dexonsmith reopened this revision.Feb 23 2021, 8:43 AM

This has unexpectedly caused a behaviour change (perhaps the same root cause as https://reviews.llvm.org/D92975#2453482, but the investigation is ongoing). I'll be reverting later today.

This revision is now accepted and ready to land.Feb 23 2021, 8:43 AM
dexonsmith planned changes to this revision.Feb 24 2021, 12:04 PM