<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div style="font-family: Calibri; font-size: 16px;">Hi,</div><div style="font-family: Calibri; font-size: 16px;"><br><div>In my source code, I have the following declaration char a[30];</div><div><br></div><div>When I'm running the following (Assuming that I is an instruction pointer pointing to the instruction to be replaced, i.e. %a = alloca [30 x i8], align 1):</div><div><br></div><div>ArrayType* arr = ArrayType::get(IntegerType::get(getGlobalContext(), 8), 10);</div><div>AllocaInst* pa = new AllocaInst(arr, "blah");</div><div>BasicBlock::iterator ii(*I);</div><div>ReplaceInstWithInst(I->getParent()->getInstList(), ii, pa);</div><div>Why am I running into Value::replaceAllUsesWith(llvm::Value*): Assertion New->getType() == getType() && "replaceAllUses of value with new value of different type!"' ?</div><div><br></div><div>Thanks,</div><div>Shivam</div></div></body></html>