[PATCH] D43363: [APInt] Fix extractBits to correctly handle Result.isSingleWord() case.

Tim Shen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 15 18:08:13 PST 2018


timshen added inline comments.


================
Comment at: llvm/trunk/lib/Support/APInt.cpp:436
         (loWord + word + 1) < NumSrcWords ? U.pVal[loWord + word + 1] : 0;
-    Result.U.pVal[word] = (w0 >> loBit) | (w1 << (APINT_BITS_PER_WORD - loBit));
+    DestPtr[word] = (w0 >> loBit) | (w1 << (APINT_BITS_PER_WORD - loBit));
   }
----------------
craig.topper wrote:
> Alternatively this could be
> 
> ```
> getRawData()[word] =....
> 
> but I don't care much.
Unfortunately getRawData() returns a const pointer. :P


Repository:
  rL LLVM

https://reviews.llvm.org/D43363





More information about the llvm-commits mailing list