1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 11:13:28 +01:00

[SimplifyLibCalls] Fix -Wunused-result after D53342/r372091

llvm-svn: 372096
This commit is contained in:
Fangrui Song 2019-09-17 09:56:55 +00:00
parent 23ec32776c
commit 540b06dd3a

View File

@ -612,7 +612,8 @@ Value *LibCallSimplifier::optimizeStrNCpy(CallInst *CI, IRBuilder<> &B) {
// strncpy(x, "", y) -> memset(align 1 x, '\0', y) // strncpy(x, "", y) -> memset(align 1 x, '\0', y)
CallInst *NewCI = B.CreateMemSet(Dst, B.getInt8('\0'), Size, 1); CallInst *NewCI = B.CreateMemSet(Dst, B.getInt8('\0'), Size, 1);
AttrBuilder ArgAttrs(CI->getAttributes().getParamAttributes(0)); AttrBuilder ArgAttrs(CI->getAttributes().getParamAttributes(0));
NewCI->getAttributes().addParamAttributes(CI->getContext(), 0, ArgAttrs); NewCI->setAttributes(NewCI->getAttributes().addParamAttributes(
CI->getContext(), 0, ArgAttrs));
return Dst; return Dst;
} }