mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
add module/file debug dumpers
This commit is contained in:
@@ -788,6 +788,24 @@ void ModuleDecl::getTopLevelDecls(SmallVectorImpl<Decl*> &Results) const {
|
||||
FORWARD(getTopLevelDecls, (Results));
|
||||
}
|
||||
|
||||
void ModuleDecl::dumpDisplayDecls() const {
|
||||
SmallVector<Decl *, 32> Decls;
|
||||
getDisplayDecls(Decls);
|
||||
for (auto *D : Decls) {
|
||||
D->dump(llvm::errs());
|
||||
llvm::errs() << "\n";
|
||||
}
|
||||
}
|
||||
|
||||
void ModuleDecl::dumpTopLevelDecls() const {
|
||||
SmallVector<Decl *, 32> Decls;
|
||||
getTopLevelDecls(Decls);
|
||||
for (auto *D : Decls) {
|
||||
D->dump(llvm::errs());
|
||||
llvm::errs() << "\n";
|
||||
}
|
||||
}
|
||||
|
||||
void ModuleDecl::getExportedPrespecializations(
|
||||
SmallVectorImpl<Decl *> &Results) const {
|
||||
FORWARD(getExportedPrespecializations, (Results));
|
||||
@@ -3062,6 +3080,22 @@ void FileUnit::getTopLevelDeclsWhereAttributesMatch(
|
||||
Results.erase(newEnd, Results.end());
|
||||
}
|
||||
|
||||
void FileUnit::dumpDisplayDecls() const {
|
||||
SmallVector<Decl *, 32> Decls;
|
||||
getDisplayDecls(Decls);
|
||||
for (auto *D : Decls) {
|
||||
D->dump(llvm::errs());
|
||||
}
|
||||
}
|
||||
|
||||
void FileUnit::dumpTopLevelDecls() const {
|
||||
SmallVector<Decl *, 32> Decls;
|
||||
getTopLevelDecls(Decls);
|
||||
for (auto *D : Decls) {
|
||||
D->dump(llvm::errs());
|
||||
}
|
||||
}
|
||||
|
||||
void swift::simple_display(llvm::raw_ostream &out, const FileUnit *file) {
|
||||
if (!file) {
|
||||
out << "(null)";
|
||||
|
||||
Reference in New Issue
Block a user