mirror of
https://github.com/Gericom/teak-llvm.git
synced 2025-06-19 19:45:40 -04:00
[NFCI] Fixed buildbots
llvm-svn: 372097
This commit is contained in:
parent
8351763709
commit
3a3dddd9d7
@ -610,10 +610,7 @@ Value *LibCallSimplifier::optimizeStrNCpy(CallInst *CI, IRBuilder<> &B) {
|
|||||||
|
|
||||||
if (SrcLen == 0) {
|
if (SrcLen == 0) {
|
||||||
// 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);
|
B.CreateMemSet(Dst, B.getInt8('\0'), Size, 1);
|
||||||
AttrBuilder ArgAttrs(CI->getAttributes().getParamAttributes(0));
|
|
||||||
NewCI->setAttributes(NewCI->getAttributes().addParamAttributes(
|
|
||||||
CI->getContext(), 0, ArgAttrs));
|
|
||||||
return Dst;
|
return Dst;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -624,8 +621,6 @@ Value *LibCallSimplifier::optimizeStrNCpy(CallInst *CI, IRBuilder<> &B) {
|
|||||||
Type *PT = Callee->getFunctionType()->getParamType(0);
|
Type *PT = Callee->getFunctionType()->getParamType(0);
|
||||||
// strncpy(x, s, c) -> memcpy(align 1 x, align 1 s, c) [s and c are constant]
|
// strncpy(x, s, c) -> memcpy(align 1 x, align 1 s, c) [s and c are constant]
|
||||||
CallInst *NewCI = B.CreateMemCpy(Dst, 1, Src, 1, ConstantInt::get(DL.getIntPtrType(PT), Len));
|
CallInst *NewCI = B.CreateMemCpy(Dst, 1, Src, 1, ConstantInt::get(DL.getIntPtrType(PT), Len));
|
||||||
// AttrBuilder ArgAttrs(CI->getAttributes().getParamAttributes(0));
|
|
||||||
// NewCI->getAttributes().addParamAttributes(CI->getContext(), 0, ArgAttrs);
|
|
||||||
NewCI->setAttributes(CI->getAttributes());
|
NewCI->setAttributes(CI->getAttributes());
|
||||||
return Dst;
|
return Dst;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user