@@ -42,15 +42,17 @@ static std::error_code collectModuleHeaderIncludes(FileManager& fileMgr, ModuleM
4242 if (!module ->isAvailable ())
4343 return std::error_code ();
4444
45- if (const FileEntry* umbrellaHeader = module ->getUmbrellaHeader ().Entry ) {
45+ if (module ->Umbrella && module ->Umbrella .is <FileEntryRef>()) {
46+ const FileEntry* umbrellaHeader = module ->Umbrella .get <FileEntryRef>();
4647 if (std::error_code err = addHeaderInclude (umbrellaHeader, includes))
4748 return err;
4849 }
49- else if (const DirectoryEntry* umbrellaDir = module ->getUmbrellaDir ().Entry ) {
50+ else if (module ->Umbrella && module ->Umbrella .is <DirectoryEntryRef>()) {
51+ const DirectoryEntryRef umbrellaDir = module ->Umbrella .get <DirectoryEntryRef>();
5052 // Add all of the headers we find in this subdirectory.
5153 std::error_code ec;
5254 SmallString<128 > dirNative;
53- path::native (umbrellaDir-> getName (), dirNative);
55+ path::native (umbrellaDir. getName (), dirNative);
5456 for (fs::recursive_directory_iterator dir (dirNative.str (), ec), dirEnd; dir != dirEnd && !ec; dir.increment (ec)) {
5557 // Check whether this entry has an extension typically associated with headers.
5658 if (!llvm::StringSwitch<bool >(path::extension (dir->path ()))
@@ -59,7 +61,8 @@ static std::error_code collectModuleHeaderIncludes(FileManager& fileMgr, ModuleM
5961 continue ;
6062
6163 // If this header is marked 'unavailable' in this module, don't include it.
62- if (const llvm::ErrorOr<const FileEntry*> header = fileMgr.getFile (dir->path ())) {
64+ auto header = fileMgr.getFileRef (dir->path ());
65+ if (header) {
6366 if (modMap.isHeaderUnavailableInModule (*header, module ))
6467 continue ;
6568
@@ -114,7 +117,7 @@ static std::error_code CreateUmbrellaHeaderForAmbientModules(const std::vector<s
114117 }
115118
116119 collectModuleHeaderIncludes (fileManager, moduleMap, module , umbrellaHeaders);
117- std::for_each (module ->submodule_begin () , module ->submodule_end (), collector);
120+ std::for_each (module ->submodules (). begin () , module ->submodules (). end (), collector);
118121 };
119122
120123 std::for_each (modules.begin (), modules.end (), collector);
0 commit comments