diff --git a/clang/include/clang/Basic/Module.h b/clang/include/clang/Basic/Module.h index 128e2adc189b2..3ecab422bc42c 100644 --- a/clang/include/clang/Basic/Module.h +++ b/clang/include/clang/Basic/Module.h @@ -149,7 +149,7 @@ class alignas(8) Module { /// The build directory of this module. This is the directory in /// which the module is notionally built, and relative to which its headers /// are found. - const DirectoryEntry *Directory = nullptr; + OptionalDirectoryEntryRefDegradesToDirectoryEntryPtr Directory; /// The presumed file name for the module map defining this module. /// Only non-empty when building from preprocessed source. diff --git a/clang/lib/Lex/ModuleMap.cpp b/clang/lib/Lex/ModuleMap.cpp index 833287c665167..6808fdfdaf4f9 100644 --- a/clang/lib/Lex/ModuleMap.cpp +++ b/clang/lib/Lex/ModuleMap.cpp @@ -181,7 +181,7 @@ OptionalFileEntryRef ModuleMap::findHeader( Module *M, const Module::UnresolvedHeaderDirective &Header, SmallVectorImpl &RelativePathName, bool &NeedsFramework) { // Search for the header file within the module's home directory. - auto *Directory = M->Directory; + auto Directory = M->Directory; SmallString<128> FullPathName(Directory->getName()); auto GetFile = [&](StringRef Filename) -> OptionalFileEntryRef {