Skip to content

Commit 131797d

Browse files
committed
[NFC] Add dumper for separately-imported overlays
1 parent 6c1b5c4 commit 131797d

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
@@ -395,6 +395,8 @@ class SourceFile final : public FileUnit {
395395
overlays.append(value.begin(), value.end());
396396
}
397397

398+
SWIFT_DEBUG_DUMPER(dumpSeparatelyImportedOverlays());
399+
398400
void cacheVisibleDecls(SmallVectorImpl<ValueDecl *> &&globals) const;
399401
const SmallVectorImpl<ValueDecl *> &getCachedVisibleDecls() const;
400402

lib/AST/Module.cpp

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1418,6 +1418,22 @@ SourceFile::getImportedModules(SmallVectorImpl<ModuleDecl::ImportedModule> &modu
14181418
}
14191419
}
14201420

1421+
void SourceFile::dumpSeparatelyImportedOverlays() const {
1422+
for (auto &pair : separatelyImportedOverlays) {
1423+
auto &underlying = std::get<0>(pair);
1424+
auto &overlays = std::get<1>(pair);
1425+
1426+
llvm::errs() << (void*)underlying << " ";
1427+
underlying->dump(llvm::errs());
1428+
1429+
for (auto overlay : overlays) {
1430+
llvm::errs() << "- ";
1431+
llvm::errs() << (void*)overlay << " ";
1432+
overlay->dump(llvm::errs());
1433+
}
1434+
}
1435+
}
1436+
14211437
void ModuleDecl::getImportedModulesForLookup(
14221438
SmallVectorImpl<ImportedModule> &modules) const {
14231439
FORWARD(getImportedModulesForLookup, (modules));

0 commit comments

Comments
 (0)