For adding the nop:<br><br>TII->insertNoop(*BB, BB->end());<br><br><br><div><span class="gmail_quote">2007/8/9, Chris Lattner <<a href="mailto:sabre@nondot.org">sabre@nondot.org</a>>:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
On Thu, 9 Aug 2007, [ISO-8859-1] Emílio Wuerges wrote:<br>> I too believe it should not be complicated.<br>> But I was not being able to do it.<br>> Finally, after some thinking (and tinkering), this worked like a charm:
<br>><br>>  MachineInstr* mi = BB->remove(BB->begin());<br>>  BB->push_back(mi);<br>><br>> But, is there a better way to do it?<br><br>This is a good way to do a single instruction.  You can also use the
<br>splice method, which allows you to move around ranges of instructions in<br>constant time.  It works the same was as std::list::splice.<br><br>-Chris<br><br>--<br><a href="http://nondot.org/sabre/">http://nondot.org/sabre/
</a><br><a href="http://llvm.org/">http://llvm.org/</a><br>_______________________________________________<br>LLVM Developers mailing list<br><a href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a>         <a href="http://llvm.cs.uiuc.edu">
http://llvm.cs.uiuc.edu</a><br><a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br><br></blockquote></div><br><br clear="all"><br>-- <br>Emilio Wuerges<br>LAPS - Laboratorio de Automacao de Projeto de Sistemas
<br>UFSC - Universidade Federal de Santa Catarina<br>Brasil