[PATCH] D33073: [APInt] Add a utility method to change the bit width and storage size of an APInt.

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 10 14:42:44 PDT 2017


craig.topper created this revision.

This adds a resize method to APInt that manages deleting/allocating storage for an APInt and changes its bit width. Use this to simplify code in copy assignment and divide.

The assignment code in particular was overly complicated. Treating every possible case as a separate implementation. I'm also pretty sure the clearUnusedBits code at the end was unnecessary. Since we always copying whole words from the source APInt. All unused bits should be clear in the source.


https://reviews.llvm.org/D33073

Files:
  include/llvm/ADT/APInt.h
  lib/Support/APInt.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D33073.98534.patch
Type: text/x-patch
Size: 4053 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170510/dac677d0/attachment.bin>


More information about the llvm-commits mailing list