Skip to content

Commit 3a3dddd

Browse files
[NFCI] Fixed buildbots
llvm-svn: 372097
1 parent 8351763 commit 3a3dddd

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -610,10 +610,7 @@ Value *LibCallSimplifier::optimizeStrNCpy(CallInst *CI, IRBuilder<> &B) {
610610

611611
if (SrcLen == 0) {
612612
// strncpy(x, "", y) -> memset(align 1 x, '\0', y)
613-
CallInst *NewCI = B.CreateMemSet(Dst, B.getInt8('\0'), Size, 1);
614-
AttrBuilder ArgAttrs(CI->getAttributes().getParamAttributes(0));
615-
NewCI->setAttributes(NewCI->getAttributes().addParamAttributes(
616-
CI->getContext(), 0, ArgAttrs));
613+
B.CreateMemSet(Dst, B.getInt8('\0'), Size, 1);
617614
return Dst;
618615
}
619616

@@ -624,8 +621,6 @@ Value *LibCallSimplifier::optimizeStrNCpy(CallInst *CI, IRBuilder<> &B) {
624621
Type *PT = Callee->getFunctionType()->getParamType(0);
625622
// strncpy(x, s, c) -> memcpy(align 1 x, align 1 s, c) [s and c are constant]
626623
CallInst *NewCI = B.CreateMemCpy(Dst, 1, Src, 1, ConstantInt::get(DL.getIntPtrType(PT), Len));
627-
// AttrBuilder ArgAttrs(CI->getAttributes().getParamAttributes(0));
628-
// NewCI->getAttributes().addParamAttributes(CI->getContext(), 0, ArgAttrs);
629624
NewCI->setAttributes(CI->getAttributes());
630625
return Dst;
631626
}

0 commit comments

Comments
 (0)