[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 957b9cdd26
commit 8351763709
1 changed files with 2 additions and 1 deletions

View File

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