Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions include/swift/AST/ImportCache.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,8 @@ class ImportSet final :
return {getTrailingObjects<ImportedModule>(),
NumTopLevelImports + NumTransitiveImports};
}

SWIFT_DEBUG_DUMP;
};

class alignas(ImportedModule) ImportCache {
Expand Down
8 changes: 5 additions & 3 deletions lib/AST/ASTDumper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1320,9 +1320,11 @@ std::string ValueDecl::printRef() const {
}

void ValueDecl::dumpRef(raw_ostream &os) const {
// Print the context.
printContext(os, getDeclContext());
os << ".";
if (!isa<ModuleDecl>(this)) {
// Print the context.
printContext(os, getDeclContext());
os << ".";
}

// Print name.
getName().printPretty(os);
Expand Down
18 changes: 18 additions & 0 deletions lib/AST/ImportCache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,24 @@ void ImportSet::Profile(
}
}

void ImportSet::dump() const {
llvm::errs() << "HasHeaderImportModule: " << HasHeaderImportModule << "\n";

llvm::errs() << "TopLevelImports:";
for (auto import : getTopLevelImports()) {
llvm::errs() << "\n- ";
simple_display(llvm::errs(), import);
}
llvm::errs() << "\n";

llvm::errs() << "TransitiveImports:";
for (auto import : getTransitiveImports()) {
llvm::errs() << "\n- ";
simple_display(llvm::errs(), import);
}
llvm::errs() << "\n";
}

static void collectExports(ImportedModule next,
SmallVectorImpl<ImportedModule> &stack) {
SmallVector<ImportedModule, 4> exports;
Expand Down