aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Transforms/Utils/BuildLibCalls.cpp
diff options
context:
space:
mode:
authorBjorn Pettersson <bjorn.a.pettersson@ericsson.com>2022-09-29 22:31:33 +0200
committerBjorn Pettersson <bjorn.a.pettersson@ericsson.com>2022-10-04 12:52:05 +0200
commit491ac8f3e81c5b6ecd364b560960cd63dccd3df7 (patch)
tree51a6c4d7f2d82cb8752951a89582b6ed605b988b /llvm/lib/Transforms/Utils/BuildLibCalls.cpp
parentaa1b64cc425665a529816505eea272927ab6a589 (diff)
downloadllvm-491ac8f3e81c5b6ecd364b560960cd63dccd3df7.zip
llvm-491ac8f3e81c5b6ecd364b560960cd63dccd3df7.tar.gz
llvm-491ac8f3e81c5b6ecd364b560960cd63dccd3df7.tar.bz2
[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
Diffstat (limited to 'llvm/lib/Transforms/Utils/BuildLibCalls.cpp')
-rw-r--r--llvm/lib/Transforms/Utils/BuildLibCalls.cpp2
1 files changed, 0 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/Utils/BuildLibCalls.cpp b/llvm/lib/Transforms/Utils/BuildLibCalls.cpp
index b55af3b..f1d1d0d 100644
--- a/llvm/lib/Transforms/Utils/BuildLibCalls.cpp
+++ b/llvm/lib/Transforms/Utils/BuildLibCalls.cpp
@@ -1841,8 +1841,6 @@ Value *llvm::emitFPutC(Value *Char, Value *File, IRBuilderBase &B,
IntTy, File->getType());
if (File->getType()->isPointerTy())
inferNonMandatoryLibFuncAttrs(M, FPutcName, *TLI);
- Char = B.CreateIntCast(Char, IntTy, /*isSigned*/true,
- "chari");
CallInst *CI = B.CreateCall(F, {Char, File}, FPutcName);
if (const Function *Fn =