+ case Intrinsic::memset: {
+ // The memset intrinsic take an extra alignment argument that the memset
+ // libc function does not.
+ const FunctionType *CFT = Callee->getFunctionType();
+ FunctionType *FT =
+ FunctionType::get(*CFT->param_begin(),
+ std::vector<const Type*>(CFT->param_begin(), CFT->param_end()-1),
+ false);
+ Function *MemSet = M->getOrInsertFunction("memset", FT);
+ new CallInst(MemSet, std::vector<Value*>(CI->op_begin()+1, CI->op_end()-1),
+ CI->getName(), CI);
+ break;
+ }