<div dir="ltr">Probably overkill, but I'd imagine the way to do this would be a trait class that implements the two different tests depending on the type of the node. (I guess a generic "isDebugInstruction" function that uses that trait could be a handy general purpose tool to have, maybe? (so you don't have to think so hard about different way s of testing whether something is a debug instruction in MC versus IR))</div><br><div class="gmail_quote"><div dir="ltr">On Thu, Jun 14, 2018 at 8:57 AM Adrian Prantl via Phabricator <<a href="mailto:reviews@reviews.llvm.org">reviews@reviews.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">aprantl added a comment.<br>
<br>
In <a href="https://reviews.llvm.org/D47874#1132374" rel="noreferrer" target="_blank">https://reviews.llvm.org/D47874#1132374</a>, @fhahn wrote:<br>
<br>
> I've updated the patch to add a skipDebugInstructionsForward utility. We have a very similar function defined in MachineBasicBlock.h, maybe we should consolidate those functions?<br>
<br>
<br>
The MachineBasicBlock.h function operates on MachineInstrs the one in BasicBlock operates on Instructions. I'm not sure how to unify these: perhaps by adding a skipForwardWhile(std::function(bool() shouldSkip) primitive to ilist?<br>
<br>
<br>
<a href="https://reviews.llvm.org/D47874" rel="noreferrer" target="_blank">https://reviews.llvm.org/D47874</a><br>
<br>
<br>
<br>
</blockquote></div>