<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/122685>122685</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Adding getNumPredecessors() for mlir::Block
</td>
</tr>
<tr>
<th>Labels</th>
<td>
mlir
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
badumbatish
</td>
</tr>
</table>
<pre>
I'm browsing the current docs for `mlir::Block` and I'm not seeing a method for `getNumPredecessors()` to compliment `getPredecessors()`, as opposed to the existing getNumSuccessors() to compliment getSuccessors().
I'd love to open a PR for this myself. `makslevental` on Discord suggested the impl is `std::distance(preds_begin, preds_end)` but I also would want further confirmation for the impl
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJxsUstu2zAQ_BrqsoghU7ZsHXRwGhjIpQjaDyj4WEls-BC4S6f5-4K2i6BpT4KImZ2Z3VFEbo6Io9g_iv1TowovKY9a2RK0YkdLo5N9H5-FPATQOb2RizPwgmBKzhgZbDIEU8og-jZ4l0V3Et3p0SfzKvoWVLRwY8fEQIiVryAgL8n-4c3IX0t4yWjRIFHKJORRyKEO4AQmhdW7UNVu4P8ihfwCiiCtayK0lVdt4i9HXDVvGt-L-Yv3afyM_BmxEe1JtKeawYJPF6yUtGIEBS_frgl4cQThndBPm-sa1Ct5vGBk5WuEFOHJkUnZApV5RuLqb0FwYfXgqHKI7W1z1hGraFDI45rR0g-Ns4s13O0Xo71vRheGZ1CeEryl4i28qcgwlcwLZjApTi4HxS7Fu8ubYGPHzg7doBoct4euP_Td0PXNMirEHcq-7XE3dUfZatSDlua42012r-S2caNs5b7dbrttK_ddv7H7aTAapWrVYA8Dil2LQTm_8f4SNinPjSMqOG6l7I_7xiuNnq5dk_LaFSlr6_JY8Q-6zCR2rXfE9DGBHXscT9Z-HPHf818DfmpfU7IfF-aV6qM8C3meHS9Fb0wKQp6rwv3zsOb0Ew0Leb4aJiHPd8-XUf4OAAD__-baCYg">