Skip to content

Commit e0f26ad

Browse files
author
Davide Italiano
committed
[SILPrinter] Print the debug scope when dumping a block.
<rdar://problem/36524469>
1 parent 36c4205 commit e0f26ad

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

lib/SIL/SILPrinter.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2215,6 +2215,14 @@ void SILBasicBlock::dump() const {
22152215
/// Pretty-print the SILBasicBlock to the designated stream.
22162216
void SILBasicBlock::print(raw_ostream &OS) const {
22172217
SILPrintContext Ctx(OS);
2218+
2219+
// Print the debug scope (and compute if we didn't do it already).
2220+
auto &SM = this->getParent()->getModule().getASTContext().SourceMgr;
2221+
for (auto &I : *this) {
2222+
SILPrinter P(Ctx);
2223+
P.printDebugScope(I.getDebugScope(), SM);
2224+
}
2225+
22182226
SILPrinter(Ctx).print(this);
22192227
}
22202228

0 commit comments

Comments
 (0)