@@ -610,10 +610,7 @@ Value *LibCallSimplifier::optimizeStrNCpy(CallInst *CI, IRBuilder<> &B) {
610
610
611
611
if (SrcLen == 0 ) {
612
612
// 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 );
617
614
return Dst;
618
615
}
619
616
@@ -624,8 +621,6 @@ Value *LibCallSimplifier::optimizeStrNCpy(CallInst *CI, IRBuilder<> &B) {
624
621
Type *PT = Callee->getFunctionType ()->getParamType (0 );
625
622
// strncpy(x, s, c) -> memcpy(align 1 x, align 1 s, c) [s and c are constant]
626
623
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);
629
624
NewCI->setAttributes (CI->getAttributes ());
630
625
return Dst;
631
626
}
0 commit comments