| 1109 | } |
| 1110 | |
| 1111 | llvm::Function* LlvmCodeGen::CloneFunction(llvm::Function* fn) { |
| 1112 | DCHECK(!is_compiled_); |
| 1113 | llvm::ValueToValueMapTy dummy_vmap; |
| 1114 | // Verifies that 'fn' has been materialized already. Callers are expected to use |
| 1115 | // GetFunction() to obtain the Function object. |
| 1116 | DCHECK(!fn->isMaterializable()); |
| 1117 | // CloneFunction() automatically gives the new function a unique name |
| 1118 | llvm::Function* fn_clone = llvm::CloneFunction(fn, dummy_vmap); |
| 1119 | fn_clone->copyAttributesFrom(fn); |
| 1120 | return fn_clone; |
| 1121 | } |
| 1122 | |
| 1123 | llvm::Function* LlvmCodeGen::FinalizeFunction(llvm::Function* function) { |
| 1124 | SetCPUAttrs(function); |
no outgoing calls