This is an archive of the discontinued LLVM Phabricator instance.

[Clang] Support more stdio builtins
ClosedPublic

Authored by qiucf on May 7 2023, 10:21 PM.

Details

Summary

Add more builtins for stdio functions as in GCC ( https://gcc.gnu.org/onlinedocs/gcc/Other-Builtins.html ), along with their mutations under IEEE float128 ABI.

Diff Detail

Event Timeline

qiucf created this revision.May 7 2023, 10:21 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 7 2023, 10:21 PM
Herald added a subscriber: kbarton. · View Herald Transcript
qiucf requested review of this revision.May 7 2023, 10:21 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 7 2023, 10:21 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript
tbaeder added inline comments.
clang/lib/CodeGen/CGBuiltin.cpp
102

The size should be increased I guess?

tuliom requested changes to this revision.May 8 2023, 6:50 AM
tuliom added inline comments.
clang/lib/CodeGen/CGBuiltin.cpp
109

Any reasons to not map these built-ins to their respective _chkieee128 counterparts? e.g. __fprintf_chkieee128.

This revision now requires changes to proceed.May 8 2023, 6:50 AM
qiucf updated this revision to Diff 523305.May 18 2023, 3:00 AM
qiucf marked an inline comment as done.
qiucf marked an inline comment as done.
qiucf added inline comments.
clang/lib/CodeGen/CGBuiltin.cpp
109

Updated.

I just saw GCC in some cases emits no-chk version when calling __builtin_*printf_chk.

tuliom accepted this revision.May 18 2023, 2:00 PM

LGTM.
Thanks!

This revision is now accepted and ready to land.May 18 2023, 2:00 PM
This revision was automatically updated to reflect the committed changes.
qiucf marked an inline comment as done.