This is an archive of the discontinued LLVM Phabricator instance.

[LibCalls] Cast Char argument to 'int' before calling emitFPutC
ClosedPublic

Authored by bjope on Oct 3 2022, 1:57 AM.

Details

Summary

The helpers in BuildLibCalls normally expect that the Value
arguments already have the correct type (matching the lib call
signature). And exception has been emitFPutC which casted the Char
argument to 'int' using CreateIntCast. This patch moves the cast to
the caller instead of doing it inside emitFPutC.

I think it makes sense to make the BuildLibCall API:s a bit
more consistent this way, despite the need to handle the int cast
in two different places now.

Diff Detail

Event Timeline

bjope created this revision.Oct 3 2022, 1:57 AM
Herald added a project: Restricted Project. · View Herald TranscriptOct 3 2022, 1:57 AM
Herald added a subscriber: hiraditya. · View Herald Transcript
bjope requested review of this revision.Oct 3 2022, 1:57 AM
Herald added a project: Restricted Project. · View Herald TranscriptOct 3 2022, 1:57 AM
nikic accepted this revision.Oct 4 2022, 3:05 AM
nikic added a subscriber: nikic.

LGTM

This revision is now accepted and ready to land.Oct 4 2022, 3:05 AM
This revision was landed with ongoing or failed builds.Oct 4 2022, 3:52 AM
This revision was automatically updated to reflect the committed changes.