[PATCH] D33073: [APInt] Add a utility method to change the bit width and storage size of an APInt.
Simon Pilgrim via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu May 11 03:02:26 PDT 2017
RKSimon added inline comments.
================
Comment at: include/llvm/ADT/APInt.h:162
+ /// deallocating as necessary. There is no guarantee on the value of the bits
+ /// after this, caller takes responsibility.
+ void resize(unsigned NewBitWidth);
----------------
Make it clear that none of the bits are guaranteed - not just any 'new' bits.
================
Comment at: lib/Support/APInt.cpp:127
+ // If the number of words is the same we can just change the width and stop.
+ if (getNumWords() != getNumWords(NewBitWidth)) {
+ BitWidth = NewBitWidth;
----------------
Shouldn't this be == ?
https://reviews.llvm.org/D33073
More information about the llvm-commits
mailing list