[LibCalls] Cast Char argument to 'int' before calling emitFPutC
authorBjorn Pettersson <bjorn.a.pettersson@ericsson.com>
Thu, 29 Sep 2022 20:31:33 +0000 (22:31 +0200)
committerBjorn Pettersson <bjorn.a.pettersson@ericsson.com>
Tue, 4 Oct 2022 10:52:05 +0000 (12:52 +0200)
commit491ac8f3e81c5b6ecd364b560960cd63dccd3df7
tree51a6c4d7f2d82cb8752951a89582b6ed605b988b
parentaa1b64cc425665a529816505eea272927ab6a589
[LibCalls] Cast Char argument to 'int' before calling emitFPutC

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.

Differential Revision: https://reviews.llvm.org/D135066
llvm/include/llvm/Transforms/Utils/BuildLibCalls.h
llvm/lib/Transforms/Utils/BuildLibCalls.cpp
llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp