[CrashReproducer] Change module map callback signature. NFC

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.

llvm-svn: 268819
This commit is contained in:
Bruno Cardoso Lopes 2016-05-06 23:21:50 +00:00
parent 35723644c2
commit f08417904d
3 changed files with 3 additions and 4 deletions

View File

@ -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 {

View File

@ -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);
}

View File

@ -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) {