[llvm-commits] [PATCH] remove BranchInst::setUnconditionalDest()

Jay Foad jay.foad at gmail.com
Fri Jan 7 04:50:43 PST 2011


These patches fix a FIXME in BranchInst::setUnconditionalDest():

  // setUnconditionalDest - Change the current branch to an unconditional branch
  // targeting the specified block.
  // FIXME: Eliminate this ugly method.

This means that BranchInsts are now created with either 1 or 3
operands, and that never changes over the lifetime of the BranchInst.
This allows some nice cleanups in the allocation and freeing of Users'
operand lists. (The complexity was originally introduced when Gabor
changed BranchInst to allocate its operands along with the
instruction, instead of as a separate allocation, here:

http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20090309/075152.html

)

The patches are, in order:

remove-uses: change the existing uses of setUnconditionalDest() to
create a new unconditional BranchInst instead
remove-impl: remove the implementation of setUnconditionalDest()
cleanup-operandlist: the cleanups mentioned above

I've tested them all with "make all check".

Comments? Or, OK to commit?

Thanks,
Jay.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: remove-uses
Type: application/octet-stream
Size: 1904 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20110107/c5a22d5d/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: remove-impl
Type: application/octet-stream
Size: 1656 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20110107/c5a22d5d/attachment-0001.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cleanup-operandlist
Type: application/octet-stream
Size: 5996 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20110107/c5a22d5d/attachment-0002.obj>


More information about the llvm-commits mailing list