[APInt] Remove references to integerPartWidth and integerPart outside of APFloat...
authorCraig Topper <craig.topper@gmail.com>
Thu, 30 Mar 2017 05:48:58 +0000 (05:48 +0000)
committerCraig Topper <craig.topper@gmail.com>
Thu, 30 Mar 2017 05:48:58 +0000 (05:48 +0000)
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.

llvm-svn: 299058

clang/lib/AST/ItaniumMangle.cpp

index dd99f20..29fcdd7 100644 (file)
@@ -982,9 +982,8 @@ void CXXNameMangler::mangleFloat(const llvm::APFloat &f) {
     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);
     hexDigit &= 0xF;
 
     // Map that over to a lowercase hex digit.