Lines Matching refs:OrigFn
110 llvm::Function *RedefineFn(llvm::Function *OrigFn,
113 llvm::FunctionType *FTy = OrigFn->getFunctionType();
120 OrigFn->getLinkage(),
121 OrigFn->getName(),
122 OrigFn->getParent());
131 NewFn->copyAttributesFrom(OrigFn);
132 NewFn->takeName(OrigFn);
134 for (auto AI=OrigFn->arg_begin(), AE=OrigFn->arg_end(),
184 for (auto &OrigFn: FunctionList) {
185 if (!IsRSFunctionOfInterest(OrigFn))
187 FunctionsToHandle.push_back(&OrigFn);
190 for (auto OrigFn: FunctionsToHandle) {
192 if (!FillArgsToDeref(OrigFn, ArgsToDeref))
195 // Replace all calls to OrigFn and erase it from parent.
196 llvm::Function *NewFn = RedefineFn(OrigFn, ArgsToDeref);
197 while (!OrigFn->use_empty()) {
198 llvm::CallSite CS(OrigFn->user_back());
201 OrigFn->eraseFromParent();