| 1033 | } |
| 1034 | |
| 1035 | int LlvmCodeGen::RemoveCallSites(llvm::Function* caller, const std::string& target_name) { |
| 1036 | DCHECK(!is_compiled_); |
| 1037 | DCHECK(caller != NULL); |
| 1038 | DCHECK(caller->getParent() == module_); |
| 1039 | |
| 1040 | vector<llvm::CallInst*> call_sites; |
| 1041 | FindCallSites(caller, target_name, &call_sites); |
| 1042 | |
| 1043 | for (llvm::CallInst* call_instr : call_sites) { |
| 1044 | call_instr->eraseFromParent(); |
| 1045 | } |
| 1046 | |
| 1047 | return call_sites.size(); |
| 1048 | } |
| 1049 | |
| 1050 | int LlvmCodeGen::InlineConstFnAttrs(const FunctionContext::TypeDesc& ret_type, |
| 1051 | const vector<FunctionContext::TypeDesc>& arg_types, llvm::Function* fn) { |