================ @@ -2257,17 +2266,27 @@ void APInt::toString(SmallVectorImpl<char> &Str, unsigned Radix, bool Signed, unsigned ShiftAmt = (Radix == 16 ? 4 : (Radix == 8 ? 3 : 1)); unsigned MaskAmt = Radix - 1; + int Pos = 0; while (Tmp.getBoolValue()) { unsigned Digit = unsigned(Tmp.getRawData()[0]) & MaskAmt; + if (insertSeparators && Pos % Grouping == 0 && Pos > 0) { + Str.push_back('\''); + } Str.push_back(Digits[Digit]); Tmp.lshrInPlace(ShiftAmt); + Pos++; } } else { + int Pos = 0; while (Tmp.getBoolValue()) { uint64_t Digit; udivrem(Tmp, Radix, Tmp, Digit); assert(Digit < Radix && "divide failed"); + if (insertSeparators && Pos % Grouping == 0 && Pos > 0) { + Str.push_back('\''); + } ---------------- AaronBallman wrote:
Here too https://github.com/llvm/llvm-project/pull/80939 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits