This is an archive of the discontinued LLVM Phabricator instance.

[libc] Add tolower, toupper implementation.
ClosedPublic

Authored by cgyurgyik on Aug 5 2020, 9:50 AM.

Details

Summary

Passes integration and libc checks!

Diff Detail

Event Timeline

cgyurgyik created this revision.Aug 5 2020, 9:50 AM
cgyurgyik requested review of this revision.Aug 5 2020, 9:50 AM
sivachandra accepted this revision.Aug 6 2020, 10:41 AM
sivachandra added inline comments.
libc/src/ctype/tolower.cpp
20

While this is smart, why should we not prefer a more readable approach like this:

return c + 'a' - 'A'; // 'a' - 'A' is a compile time constant so this is effectively just one add instruction.
libc/src/ctype/toupper.cpp
20

Same here.

This revision is now accepted and ready to land.Aug 6 2020, 10:41 AM
cgyurgyik updated this revision to Diff 283698.Aug 6 2020, 12:12 PM

Address Siva's comments.

cgyurgyik marked 2 inline comments as done.Aug 6 2020, 12:12 PM
This revision was landed with ongoing or failed builds.Aug 6 2020, 12:22 PM
This revision was automatically updated to reflect the committed changes.