diff --git a/include/clang/Lex/ModuleMap.h b/include/clang/Lex/ModuleMap.h index b8cfb8faa8dab923021f060d1203c02432e70b79..313cfbe76686029e100b55c2f18acafbf4aeba5c 100644 --- a/include/clang/Lex/ModuleMap.h +++ b/include/clang/Lex/ModuleMap.h @@ -54,7 +54,7 @@ public: /// \brief Called when a header is added during module map parsing. /// /// \param File The header file itself. - virtual void moduleMapAddHeader(const FileEntry &File) {} + virtual void moduleMapAddHeader(StringRef Filename) {} }; class ModuleMap { diff --git a/lib/Frontend/ModuleDependencyCollector.cpp b/lib/Frontend/ModuleDependencyCollector.cpp index 02d3c515ef0561f3497c86bc01f601d8fe48801d..4ef3b1ee2e9ac28369273595a9540e804184df82 100644 --- a/lib/Frontend/ModuleDependencyCollector.cpp +++ b/lib/Frontend/ModuleDependencyCollector.cpp @@ -44,8 +44,7 @@ struct ModuleDependencyMMCallbacks : public ModuleMapCallbacks { ModuleDependencyMMCallbacks(ModuleDependencyCollector &Collector) : Collector(Collector) {} - void moduleMapAddHeader(const FileEntry &File) override { - StringRef HeaderPath = File.getName(); + void moduleMapAddHeader(StringRef HeaderPath) override { if (llvm::sys::path::is_absolute(HeaderPath)) Collector.addFile(HeaderPath); } diff --git a/lib/Lex/ModuleMap.cpp b/lib/Lex/ModuleMap.cpp index 467ae7ec5181214f3451d6165c35d04c79f933ec..39ded6f61343e2baace2dc79c6f48a60bfebf166 100644 --- a/lib/Lex/ModuleMap.cpp +++ b/lib/Lex/ModuleMap.cpp @@ -809,7 +809,7 @@ void ModuleMap::addHeader(Module *Mod, Module::Header Header, // Notify callbacks that we just added a new header. for (const auto &Cb : Callbacks) - Cb->moduleMapAddHeader(*Header.Entry); + Cb->moduleMapAddHeader(Header.Entry->getName()); } void ModuleMap::excludeHeader(Module *Mod, Module::Header Header) {