File tree Expand file tree Collapse file tree 2 files changed +15
-0
lines changed
include/swift/SILOptimizer/Utils Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -270,6 +270,9 @@ class ValueLifetimeAnalysis {
270
270
// / It is assumed that \p Inst is located after the value's definition.
271
271
bool isWithinLifetime (SILInstruction *Inst);
272
272
273
+ // / For debug dumping.
274
+ void dump () const ;
275
+
273
276
private:
274
277
275
278
// / The value.
Original file line number Diff line number Diff line change @@ -1240,6 +1240,18 @@ bool ValueLifetimeAnalysis::isWithinLifetime(SILInstruction *Inst) {
1240
1240
llvm_unreachable (" Expected to find use of value in block!" );
1241
1241
}
1242
1242
1243
+ void ValueLifetimeAnalysis::dump () const {
1244
+ llvm::errs () << " lifetime of def: " << *DefValue;
1245
+ for (SILInstruction *Use : UserSet) {
1246
+ llvm::errs () << " use: " << *Use;
1247
+ }
1248
+ llvm::errs () << " live blocks:" ;
1249
+ for (SILBasicBlock *BB : LiveBlocks) {
1250
+ llvm::errs () << ' ' << BB->getDebugID ();
1251
+ }
1252
+ llvm::errs () << ' \n ' ;
1253
+ }
1254
+
1243
1255
// ===----------------------------------------------------------------------===//
1244
1256
// Casts Optimization and Simplification
1245
1257
// ===----------------------------------------------------------------------===//
You can’t perform that action at this time.
0 commit comments