Skip to content

Commit 8351763

Browse files
committed
[SimplifyLibCalls] Fix -Wunused-result after D53342/r372091
llvm-svn: 372096
1 parent 957b9cd commit 8351763

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -612,7 +612,8 @@ Value *LibCallSimplifier::optimizeStrNCpy(CallInst *CI, IRBuilder<> &B) {
612612
// strncpy(x, "", y) -> memset(align 1 x, '\0', y)
613613
CallInst *NewCI = B.CreateMemSet(Dst, B.getInt8('\0'), Size, 1);
614614
AttrBuilder ArgAttrs(CI->getAttributes().getParamAttributes(0));
615-
NewCI->getAttributes().addParamAttributes(CI->getContext(), 0, ArgAttrs);
615+
NewCI->setAttributes(NewCI->getAttributes().addParamAttributes(
616+
CI->getContext(), 0, ArgAttrs));
616617
return Dst;
617618
}
618619

0 commit comments

Comments
 (0)