Deleted Added
full compact
21a22
> #include "llvm/LLVMContext.h"
132c133,134
< if (ArgumentConstants[i].second || AI->use_empty())
---
> if (ArgumentConstants[i].second || AI->use_empty() ||
> (AI->hasByValAttr() && !F.onlyReadsMemory()))
154c156
< if (F.getReturnType() == Type::VoidTy)
---
> if (F.getReturnType() == Type::getVoidTy(F.getContext()))
160a163,164
>
> LLVMContext &Context = F.getContext();
185c189
< V = FindInsertedValue(RI->getOperand(0), i);
---
> V = FindInsertedValue(RI->getOperand(0), i, Context);