[llvm-commits] CVS: llvm/lib/Support/APInt.cpp

Reid Spencer reid at x10sys.com
Fri May 18 17:30:13 PDT 2007



Changes in directory llvm/lib/Support:

APInt.cpp updated: 1.85 -> 1.86
---
Log message:

Fix an assertion introduced by my last change to the toString method. We
can't use getZExtValue() to extract the low order bits for each digit. 
Instead, we need to access the low order word directly.


---
Diffs of the changes:  (+2 -2)

 APInt.cpp |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)


Index: llvm/lib/Support/APInt.cpp
diff -u llvm/lib/Support/APInt.cpp:1.85 llvm/lib/Support/APInt.cpp:1.86
--- llvm/lib/Support/APInt.cpp:1.85	Thu May 17 14:23:02 2007
+++ llvm/lib/Support/APInt.cpp	Fri May 18 19:29:55 2007
@@ -1962,9 +1962,9 @@
       uint64_t mask = radix - 1;
       APInt zero(tmp.getBitWidth(), 0);
       while (tmp.ne(zero)) {
-        unsigned digit = tmp.getZExtValue() & mask;
-        tmp = tmp.lshr(shift);
+        unsigned digit = (tmp.isSingleWord() ? tmp.VAL : tmp.pVal[0]) & mask;
         result.insert(insert_at, digits[digit]);
+        tmp = tmp.lshr(shift);
       }
     }
     return result;






More information about the llvm-commits mailing list