Use a StringRef instead of a FileEntry in the moduleMapAddHeader
callback to allow more flexibility on what to collect on further
patches. This changes the interface I introduced in r264971.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@268819
91177308-0d34-0410-b5e6-
96231b3b80d8
/// \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 {
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);
}
// 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) {