This is an archive of the discontinued LLVM Phabricator instance.

[libc] Extend IntegerToString to convert UInt* numbers to hex string.
ClosedPublic

Authored by sivachandra on May 18 2023, 1:30 AM.

Details

Summary

This new functionality will help us avoid duplicated code in various
places in the testing infrastructure. Since the string representation
of the wide numbers is to be used by tests, to keep it simple, we
zero-pad the strings.

Diff Detail

Event Timeline

sivachandra created this revision.May 18 2023, 1:30 AM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptMay 18 2023, 1:30 AM
sivachandra requested review of this revision.May 18 2023, 1:30 AM
lntue accepted this revision.May 18 2023, 6:37 AM
lntue added inline comments.
libc/src/__support/integer_to_string.h
186

I don't think we need to do & MASK in here, as the cast is well-defined. If it's not correct, then we need to fix the cast to uintmax_t instead.

This revision is now accepted and ready to land.May 18 2023, 6:37 AM

Remove an unnecessary masking operation.

This revision was landed with ongoing or failed builds.May 18 2023, 9:44 AM
This revision was automatically updated to reflect the committed changes.