@@ -42,15 +42,17 @@ static std::error_code collectModuleHeaderIncludes(FileManager& fileMgr, ModuleM
42
42
if (!module->isAvailable ())
43
43
return std::error_code ();
44
44
45
- if (const FileEntry* umbrellaHeader = module->getUmbrellaHeader ().Entry ) {
45
+ if (module->Umbrella && module->Umbrella .is <FileEntryRef>()) {
46
+ const FileEntry* umbrellaHeader = module->Umbrella .get <FileEntryRef>();
46
47
if (std::error_code err = addHeaderInclude (umbrellaHeader, includes))
47
48
return err;
48
49
}
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>();
50
52
// Add all of the headers we find in this subdirectory.
51
53
std::error_code ec;
52
54
SmallString<128 > dirNative;
53
- path::native (umbrellaDir-> getName (), dirNative);
55
+ path::native (umbrellaDir. getName (), dirNative);
54
56
for (fs::recursive_directory_iterator dir (dirNative.str (), ec), dirEnd; dir != dirEnd && !ec; dir.increment (ec)) {
55
57
// Check whether this entry has an extension typically associated with headers.
56
58
if (!llvm::StringSwitch<bool >(path::extension (dir->path ()))
@@ -59,7 +61,8 @@ static std::error_code collectModuleHeaderIncludes(FileManager& fileMgr, ModuleM
59
61
continue ;
60
62
61
63
// 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) {
63
66
if (modMap.isHeaderUnavailableInModule (*header, module))
64
67
continue ;
65
68
@@ -114,7 +117,7 @@ static std::error_code CreateUmbrellaHeaderForAmbientModules(const std::vector<s
114
117
}
115
118
116
119
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);
118
121
};
119
122
120
123
std::for_each (modules.begin (), modules.end (), collector);
0 commit comments