Skip to content

Commit d069fff

Browse files
[SILDebugInfo] Only print under !NDEBUG. (#62325)
1 parent 03b3841 commit d069fff

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

include/swift/SIL/SILDebugScope.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,10 +88,12 @@ class SILDebugScope : public SILAllocated<SILDebugScope> {
8888
return callSite;
8989
}
9090

91+
#ifndef NDEBUG
9192
void print(SourceManager &SM, llvm::raw_ostream &OS = llvm::errs(),
9293
unsigned Indent = 0) const;
9394

9495
void print(SILModule &Mod) const;
96+
#endif
9597
};
9698

9799
/// Determine whether an instruction may not have a SILDebugScope.

lib/SIL/Verifier/SILVerifier.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5845,12 +5845,16 @@ class SILVerifier : public SILVerifierBase<SILVerifier> {
58455845
if (DS != LastSeenScope) {
58465846
llvm::errs() << "Broken instruction!\n";
58475847
SI.dump();
5848+
#ifndef NDEBUG
58485849
llvm::errs() << "in scope\n";
58495850
DS->print(SI.getFunction()->getModule());
5851+
#endif
58505852
llvm::errs() << "Previous, non-contiguous scope set by";
58515853
LastSeenScopeInst->dump();
5854+
#ifndef NDEBUG
58525855
llvm::errs() << "in scope\n";
58535856
LastSeenScope->print(SI.getFunction()->getModule());
5857+
#endif
58545858
llvm::errs() << "Please report a bug on bugs.swift.org\n";
58555859
llvm::errs() <<
58565860
"Pass -Xllvm -verify-di-holes=false to disable the verification\n";

0 commit comments

Comments
 (0)