[llvm-commits] [PATCH] fix a FIXME in SwitchInst::removeCase()

Jay Foad jay.foad at gmail.com
Mon Jan 31 07:24:53 PST 2011


SwitchInst::removeCase() has this comment:

  // Move everything after this operand down.
  //
  // FIXME: we could just swap with the end of the list, then erase.  However,
  // client might not expect this to happen.  The code as it is thrashes the
  // use/def lists, which is kinda lame.

I've looked at all calls to removeCase() in the LLVM tree, and I don't
think any of them will care if the cases get reordered. So the
attached patch implements the more efficient approach described in the
comment, and removes the FIXME.

Tested with "make check". OK to commit?

Thanks,
Jay.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: removecase
Type: application/octet-stream
Size: 854 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20110131/4a198c0a/attachment.obj>


More information about the llvm-commits mailing list