Skip to content

Commit d4eabeb

Browse files
committed
[NFC] Add dumper for separately-imported overlays
1 parent 823d3d4 commit d4eabeb

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

include/swift/AST/SourceFile.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -389,6 +389,8 @@ class SourceFile final : public FileUnit {
389389
overlays.append(value.begin(), value.end());
390390
}
391391

392+
SWIFT_DEBUG_DUMPER(dumpSeparatelyImportedOverlays());
393+
392394
void cacheVisibleDecls(SmallVectorImpl<ValueDecl *> &&globals) const;
393395
const SmallVectorImpl<ValueDecl *> &getCachedVisibleDecls() const;
394396

lib/AST/Module.cpp

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1430,6 +1430,22 @@ SourceFile::getImportedModules(SmallVectorImpl<ModuleDecl::ImportedModule> &modu
14301430
}
14311431
}
14321432

1433+
void SourceFile::dumpSeparatelyImportedOverlays() const {
1434+
for (auto &pair : separatelyImportedOverlays) {
1435+
auto &underlying = std::get<0>(pair);
1436+
auto &overlays = std::get<1>(pair);
1437+
1438+
llvm::errs() << (void*)underlying << " ";
1439+
underlying->dump(llvm::errs());
1440+
1441+
for (auto overlay : overlays) {
1442+
llvm::errs() << "- ";
1443+
llvm::errs() << (void*)overlay << " ";
1444+
overlay->dump(llvm::errs());
1445+
}
1446+
}
1447+
}
1448+
14331449
void ModuleDecl::getImportedModulesForLookup(
14341450
SmallVectorImpl<ImportedModule> &modules) const {
14351451
FORWARD(getImportedModulesForLookup, (modules));

0 commit comments

Comments
 (0)