OtherPtr is ensured above to have the type PointerType::get(AI->getAllocatedType(), AddrSpace).
Wrong type, NewElts is an array of AllocaInst*, and I believe EltPtr is assigned something that is not an AllocaInst* (or used to, looking again at it doesn't seem to be the case atm).
See previous comment. In this case, SrcField *does* get assigned, so I can't change its type to AllocaInst*.
Thanks for all the work/patches posted here. Will be getting to the reviews as quick as I can.
This one looks good, please commit!
Could throw in an assert to that effect if you like
Feel free to correct the type (since, as you say, it's no longer reused for other things) & reuse it if you like