Make module files passed to a module build via -fmodule-file= available to
consumers of that module. Previously, such a file would only be available if the module happened to actually import something from that module. llvm-svn: 232583
This commit is contained in:
@@ -227,6 +227,15 @@ ModuleManager::addInMemoryBuffer(StringRef FileName,
|
||||
InMemoryBuffers[Entry] = std::move(Buffer);
|
||||
}
|
||||
|
||||
bool ModuleManager::addKnownModuleFile(StringRef FileName) {
|
||||
const FileEntry *File;
|
||||
if (lookupModuleFile(FileName, 0, 0, File))
|
||||
return true;
|
||||
if (!Modules.count(File))
|
||||
AdditionalKnownModuleFiles.insert(File);
|
||||
return false;
|
||||
}
|
||||
|
||||
ModuleManager::VisitState *ModuleManager::allocateVisitState() {
|
||||
// Fast path: if we have a cached state, use it.
|
||||
if (FirstVisitState) {
|
||||
@@ -263,6 +272,8 @@ void ModuleManager::setGlobalIndex(GlobalModuleIndex *Index) {
|
||||
}
|
||||
|
||||
void ModuleManager::moduleFileAccepted(ModuleFile *MF) {
|
||||
AdditionalKnownModuleFiles.remove(MF->File);
|
||||
|
||||
if (!GlobalIndex || GlobalIndex->loadedModuleFile(MF))
|
||||
return;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user