mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[silgen] Create CleanupManager::dump and the relevant dump methods to dump the current cleanups.
This is useful to discover when a specific cleanup is being eliminated while debugging. The implementation is compiled out when assertions are disabled. rdar://29791263
This commit is contained in:
@@ -3805,6 +3805,14 @@ public:
|
||||
void emit(SILGenFunction &gen, CleanupLocation l) override {
|
||||
gen.B.createDeallocBox(l, box);
|
||||
}
|
||||
|
||||
void dump() const override {
|
||||
#ifndef NDEBUG
|
||||
llvm::errs() << "DeallocateUninitializedBox "
|
||||
<< "State:" << getState() << " "
|
||||
<< "Box: " << box << "\n";
|
||||
#endif
|
||||
}
|
||||
};
|
||||
} // end anonymous namespace
|
||||
|
||||
@@ -4423,7 +4431,7 @@ namespace {
|
||||
uncurriedArgs.end());
|
||||
uncurriedArgs[foreignSelf.getSelfIndex()] = selfArg;
|
||||
}
|
||||
|
||||
|
||||
// Emit the uncurried call.
|
||||
|
||||
// Special case for superclass method calls.
|
||||
@@ -4922,6 +4930,14 @@ namespace {
|
||||
void emit(SILGenFunction &gen, CleanupLocation l) override {
|
||||
gen.emitUninitializedArrayDeallocation(l, Array);
|
||||
}
|
||||
|
||||
void dump() const override {
|
||||
#ifndef NDEBUG
|
||||
llvm::errs() << "DeallocateUninitializedArray "
|
||||
<< "State:" << getState() << " "
|
||||
<< "Array:" << Array << "\n";
|
||||
#endif
|
||||
}
|
||||
};
|
||||
} // end anonymous namespace
|
||||
|
||||
|
||||
Reference in New Issue
Block a user