<html><head><meta http-equiv="Content-Type" content="text/html; charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div class="">Within a basic block this is just normal iterator usage/manipulation:</div><div class=""><br class=""></div>for (instr : llvm::make_range(FromInstruction.getIterator(), ToInstruction.getIterator())) { ... }<div class=""><br class=""></div><div class="">Use std::next() on ToInstruction.getIterator() if you want it included.</div><div class=""><br class=""></div><div class="">- Matthias<br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On Apr 9, 2018, at 10:04 AM, Alexandre Isoard via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" class="">llvm-dev@lists.llvm.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">Hello,<div class=""><br class=""></div><div class="">Is there an iterator to iterate over a "range" of instructions in a Function?</div><div class=""><br class=""></div><div class="">"range" meaning from an instruction::iterator up to an other instruction::iterator which either:</div><div class="">- point to instructions in the same basic block (the first one first, second one second)</div><div class="">- point to instructions in different basic block (the BB of the first dominate the BB of the second, and the BB of the second post-dominate the BB of the first)</div><div class=""><br class=""></div><div class="">I'm not sure if I can trick InstIterator into doing that for me (with a custom BB type?).<br clear="all" class=""><div class=""><br class=""></div>-- <br class=""><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr" class=""><b class="">Alexandre Isoard</b><br class=""></div></div>
</div></div>
_______________________________________________<br class="">LLVM Developers mailing list<br class=""><a href="mailto:llvm-dev@lists.llvm.org" class="">llvm-dev@lists.llvm.org</a><br class="">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev<br class=""></div></blockquote></div><br class=""></div></body></html>