Skip to content

Commit 987773f

Browse files
committed
Fix compile errors when building without assertions.
1 parent 093aadb commit 987773f

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

lib/SILOptimizer/PassManager/PassManager.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,9 +199,12 @@ static void printModule(SILModule *Mod, bool EmitVerboseSIL) {
199199
}
200200

201201
class DebugPrintEnabler {
202+
#ifndef NDEBUG
202203
bool OldDebugFlag;
204+
#endif
203205
public:
204206
DebugPrintEnabler(unsigned PassNumber) {
207+
#ifndef NDEBUG
205208
OldDebugFlag = llvm::DebugFlag;
206209
if (llvm::DebugFlag)
207210
return;
@@ -215,10 +218,13 @@ class DebugPrintEnabler {
215218
return;
216219
}
217220
}
221+
#endif
218222
}
219223

220224
~DebugPrintEnabler() {
225+
#ifndef NDEBUG
221226
llvm::DebugFlag = OldDebugFlag;
227+
#endif
222228
}
223229
};
224230

0 commit comments

Comments
 (0)