mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-29 06:26:08 +00:00
Module files representing actual modules don't need to know the set of modules they import, since that information isn't actually used. Drop it from the AST file
llvm-svn: 145738
This commit is contained in:
parent
0a8391362e
commit
959bb06e96
@ -3335,25 +3335,26 @@ void ASTWriter::WriteASTCore(Sema &SemaRef, MemorizeStatCalls *StatCalls,
|
||||
I != E; ++I)
|
||||
WriteDeclContextVisibleUpdate(*I);
|
||||
|
||||
// Write the submodules that were imported, if any.
|
||||
RecordData ImportedModules;
|
||||
for (ASTContext::import_iterator I = Context.local_import_begin(),
|
||||
IEnd = Context.local_import_end();
|
||||
I != IEnd; ++I) {
|
||||
assert(SubmoduleIDs.find(I->getImportedModule()) != SubmoduleIDs.end());
|
||||
ImportedModules.push_back(SubmoduleIDs[I->getImportedModule()]);
|
||||
}
|
||||
if (!ImportedModules.empty()) {
|
||||
// Sort module IDs.
|
||||
llvm::array_pod_sort(ImportedModules.begin(), ImportedModules.end());
|
||||
|
||||
// Unique module IDs.
|
||||
ImportedModules.erase(std::unique(ImportedModules.begin(),
|
||||
ImportedModules.end()),
|
||||
ImportedModules.end());
|
||||
|
||||
Stream.EmitRecord(IMPORTED_MODULES, ImportedModules);
|
||||
ImportedModules.clear();
|
||||
if (!WritingModule) {
|
||||
// Write the submodules that were imported, if any.
|
||||
RecordData ImportedModules;
|
||||
for (ASTContext::import_iterator I = Context.local_import_begin(),
|
||||
IEnd = Context.local_import_end();
|
||||
I != IEnd; ++I) {
|
||||
assert(SubmoduleIDs.find(I->getImportedModule()) != SubmoduleIDs.end());
|
||||
ImportedModules.push_back(SubmoduleIDs[I->getImportedModule()]);
|
||||
}
|
||||
if (!ImportedModules.empty()) {
|
||||
// Sort module IDs.
|
||||
llvm::array_pod_sort(ImportedModules.begin(), ImportedModules.end());
|
||||
|
||||
// Unique module IDs.
|
||||
ImportedModules.erase(std::unique(ImportedModules.begin(),
|
||||
ImportedModules.end()),
|
||||
ImportedModules.end());
|
||||
|
||||
Stream.EmitRecord(IMPORTED_MODULES, ImportedModules);
|
||||
}
|
||||
}
|
||||
|
||||
WriteDeclUpdatesBlocks();
|
||||
|
Loading…
x
Reference in New Issue
Block a user