Skip to content

[sil] Add an overload to SILDebugScope::dump that just takes a SILMod… #25411

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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
6 changes: 4 additions & 2 deletions include/swift/SIL/SILDebugScope.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,10 @@ class SILDebugScope : public SILAllocated<SILDebugScope> {
SILFunction *getParentFunction() const;

#ifndef NDEBUG
void dump(SourceManager &SM, llvm::raw_ostream &OS = llvm::errs(),
unsigned Indent = 0) const;
LLVM_ATTRIBUTE_DEPRECATED(void dump(SourceManager &SM, llvm::raw_ostream &OS = llvm::errs(),
unsigned Indent = 0) const,
"only for use in the debugger");
LLVM_ATTRIBUTE_DEPRECATED(void dump(SILModule &Mod) const, "only for use in the debugger");
#endif
};

Expand Down
6 changes: 6 additions & 0 deletions lib/SIL/SILPrinter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3005,6 +3005,12 @@ void SILDebugScope::dump(SourceManager &SM, llvm::raw_ostream &OS,
}
OS << "}\n";
}

void SILDebugScope::dump(SILModule &Mod) const {
// We just use the default indent and llvm::errs().
dump(Mod.getASTContext().SourceMgr);
}

#endif

void SILSpecializeAttr::print(llvm::raw_ostream &OS) const {
Expand Down