\brief Build the code for the expression trees for default mode with a LLVM ObjectCache. Each element in the vector represents an expression tree
| 91 | /// \brief Build the code for the expression trees for default mode with a LLVM |
| 92 | /// ObjectCache. Each element in the vector represents an expression tree |
| 93 | Status LLVMGenerator::Build(const ExpressionVector& exprs, SelectionVector::Mode mode) { |
| 94 | selection_vector_mode_ = mode; |
| 95 | |
| 96 | for (auto& expr : exprs) { |
| 97 | auto output = annotator_.AddOutputFieldDescriptor(expr->result()); |
| 98 | ARROW_RETURN_NOT_OK(Add(expr, output)); |
| 99 | } |
| 100 | |
| 101 | // Compile and inject into the process' memory the generated function. |
| 102 | ARROW_RETURN_NOT_OK(engine_->FinalizeModule()); |
| 103 | |
| 104 | // setup the jit functions for each expression. |
| 105 | for (auto& compiled_expr : compiled_exprs_) { |
| 106 | auto fn_name = compiled_expr->GetFunctionName(mode); |
| 107 | ARROW_ASSIGN_OR_RAISE(auto fn_ptr, engine_->CompiledFunction(fn_name)); |
| 108 | auto jit_fn = reinterpret_cast<EvalFunc>(fn_ptr); |
| 109 | compiled_expr->SetJITFunction(selection_vector_mode_, jit_fn); |
| 110 | } |
| 111 | |
| 112 | return Status::OK(); |
| 113 | } |
| 114 | |
| 115 | /// \brief Build the code for the expression trees for default mode. Each |
| 116 | /// element in the vector represents an expression tree |
no test coverage detected