This is an archive of the discontinued LLVM Phabricator instance.

[libc][NFC] Make IntegerToString simpler to use at call-sites.
ClosedPublic

Authored by sivachandra on Aug 15 2022, 11:54 PM.

Diff Detail

Event Timeline

sivachandra created this revision.Aug 15 2022, 11:54 PM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptAug 15 2022, 11:54 PM
sivachandra requested review of this revision.Aug 15 2022, 11:54 PM

Overall LGTM with some nits.

libc/src/__support/integer_to_string.h
27

This should be false for uppercase.

153

instead of specifying false here, you could leave this blank since lowercase has a default value already. Same below.

libc/src/__support/threads/linux/thread.cpp
279–280

you could use dec_bufsize<int> here

libc/src/stdio/printf_core/int_converter.h
68–69

you could use oct_bufsize<intmax_t> here

Address comments

sivachandra marked 4 inline comments as done.Aug 16 2022, 3:45 PM
This revision is now accepted and ready to land.Aug 16 2022, 3:58 PM