| 248 | } |
| 249 | |
| 250 | Status LlvmCodeGen::CreateFromFile(FragmentState* state, ObjectPool* pool, |
| 251 | MemTracker* parent_mem_tracker, const string& file, const string& id, |
| 252 | scoped_ptr<LlvmCodeGen>* codegen) { |
| 253 | codegen->reset(new LlvmCodeGen(state, pool, parent_mem_tracker, id)); |
| 254 | SCOPED_TIMER((*codegen)->profile_->total_time_counter()); |
| 255 | SCOPED_THREAD_COUNTER_MEASUREMENT((*codegen)->llvm_thread_counters()); |
| 256 | |
| 257 | unique_ptr<llvm::Module> loaded_module; |
| 258 | Status status = (*codegen)->LoadModuleFromFile(file, &loaded_module); |
| 259 | if (!status.ok()) goto error; |
| 260 | status = (*codegen)->Init(move(loaded_module)); |
| 261 | if (!status.ok()) goto error; |
| 262 | return Status::OK(); |
| 263 | error: |
| 264 | (*codegen)->Close(); |
| 265 | return status; |
| 266 | } |
| 267 | |
| 268 | Status LlvmCodeGen::CreateFromMemory(FragmentState* state, ObjectPool* pool, |
| 269 | MemTracker* parent_mem_tracker, const string& id, scoped_ptr<LlvmCodeGen>* codegen) { |
nothing calls this directly
no test coverage detected