This avoids crashing when trying to dump an operation nested in a region that isn't yet attached to an operation, which is quite useful when debugging.
This alone won't be enough to print an unlink Operation, it'll display `<<UNLINKED INSTRUCTION>>`.
--
PiperOrigin-RevId:
249496388
}
Operation *Region::getContainingOp() {
- assert(!container.isNull() && "no container");
return container.dyn_cast<Operation *>();
}
Function *Region::getContainingFunction() {
- assert(!container.isNull() && "no container");
return container.dyn_cast<Function *>();
}