<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div dir="ltr" style="font-family: Calibri; font-size: 16px;"><span style="font-size: 12pt;">Hi,</span></div><div dir="ltr" style="font-family: Calibri; font-size: 16px;"><br></div><div dir="ltr" style="font-family: Calibri; font-size: 16px;">I have the following instruction in my IR-</div><div dir="ltr" style="font-family: Calibri; font-size: 16px;">%call2 = call i8* @strcpy(i8* %1, i8* %2) #2</div><div dir="ltr" style="font-family: Calibri; font-size: 16px;"><br></div><div dir="ltr" style="font-family: Calibri; font-size: 16px;">I intend to change call to strcpy with strncpy. I have included the following code in runOnFunction, so that when it is strcpy's turn to be invoked, strncpy is invoked instead.</div><div dir="ltr" style="font-family: Calibri; font-size: 16px;"><br></div><div dir="ltr" style="font-family: Calibri; font-size: 16px;">Assuming I* is the strcpy instruction,</div><div dir="ltr" style="font-family: Calibri; font-size: 16px;"><br></div><div dir="ltr" style="font-family: Calibri; font-size: 16px;">CallInst* x=new CallInst::CreateCall3(strncpy,1,2,ConstantInt(16),llvm::Twine("my_strncpy"));</div><div dir="ltr" style="font-family: Calibri; font-size: 16px;">ReplaceInstWithInst(I*,x);</div><div dir="ltr" style="font-family: Calibri; font-size: 16px;"><br></div><div dir="ltr" style="font-family: Calibri; font-size: 16px;">I'm running into a whole bunch of errors in CreateCall3(). How can I go about writing this correctly?</div><div dir="ltr" style="font-family: Calibri; font-size: 16px;"><br></div><div dir="ltr" style="font-family: Calibri; font-size: 16px;">Any help would be appreciated.</div><div dir="ltr" style="font-family: Calibri; font-size: 16px;"><br></div><div dir="ltr" style="font-family: Calibri; font-size: 16px;">Thanks.</div></body></html>