On Thu, Mar 30, 2017 at 7:48 AM, Craig Topper via cfe-commits <
cfe-commits@lists.llvm.org> wrote:

> Author: ctopper
> Date: Thu Mar 30 00:48:58 2017
> New Revision: 299058
>
> URL: http://llvm.org/viewvc/llvm-project?rev=299058&view=rev
> Log:
> [APInt] Remove references to integerPartWidth and integerPart outside of
> APFloat implentation.
>
> Turns out integerPartWidth only explicitly defines the width of the tc
> functions in the APInt class. Functions that aren't used by APInt
> implementation itself. Many places in the code base already assume APInt is
> made up of 64-bit pieces. Explicitly assuming 64-bit here doesn't make that
> situation much worse. A full audit would need to be done if it ever changes.
>
> Modified:
>     cfe/trunk/lib/AST/ItaniumMangle.cpp
>
> Modified: cfe/trunk/lib/AST/ItaniumMangle.cpp
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/
> ItaniumMangle.cpp?rev=299058&r1=299057&r2=299058&view=diff
> ============================================================
> ==================
> --- cfe/trunk/lib/AST/ItaniumMangle.cpp (original)
> +++ cfe/trunk/lib/AST/ItaniumMangle.cpp Thu Mar 30 00:48:58 2017
> @@ -982,9 +982,8 @@ void CXXNameMangler::mangleFloat(const l
>      unsigned digitBitIndex = 4 * (numCharacters - stringIndex - 1);
>
>      // Project out 4 bits starting at 'digitIndex'.
> -    llvm::integerPart hexDigit
> -      = valueBits.getRawData()[digitBitIndex / llvm::integerPartWidth];
> -    hexDigit >>= (digitBitIndex % llvm::integerPartWidth);
> +    uint64_t hexDigit = valueBits.getRawData()[digitBitIndex / 64];
> +    hexDigit >>= (digitBitIndex % 64);
>

Would be nice to use APINT_BITS_PER_WORD to make this coupling more
explicit.


>      hexDigit &= 0xF;
>
>      // Map that over to a lowercase hex digit.
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits@lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
>
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to