HomePhabricator

Module: Use FileEntryRef and DirectoryEntryRef in Umbrella, Header, and…

Authored by dexonsmith on Oct 30 2020, 1:10 PM.

Description

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

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.

Differential Revision: https://reviews.llvm.org/D90497