Skip to content

Commit 4dde3ac

Browse files
committed
[NFC] Convert DWARF Module import graph query into assertion
DWARF-imported modules should have no external dependencies on other modules. This call will just wind up returning the same result every time. Let's use it to assert that this is always the case going forward.
1 parent 565478c commit 4dde3ac

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/ClangImporter/DWARFImporter.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,9 @@ ModuleDecl *ClangImporter::Implementation::loadModuleDWARF(
118118
decl->addFile(*wrapperUnit);
119119

120120
// Force load overlay modules for all imported modules.
121-
(void) namelookup::getAllImports(decl);
121+
assert(namelookup::getAllImports(decl).size() == 1 &&
122+
namelookup::getAllImports(decl).front().importedModule == decl &&
123+
"DWARF module depends on additional modules?");
122124

123125
// Register the module with the ASTContext so it is available for lookups.
124126
if (!SwiftContext.getLoadedModule(name))

0 commit comments

Comments
 (0)