OmniSciDB  1dac507f6e
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
anonymous_namespace{TableFunctionCompilationContext.cpp} Namespace Reference

Functions

llvm::Function * generate_entry_point (const CgenState *cgen_state)
 

Function Documentation

llvm::Function* anonymous_namespace{TableFunctionCompilationContext.cpp}::generate_entry_point ( const CgenState cgen_state)

Definition at line 31 of file TableFunctionCompilationContext.cpp.

References CgenState::context_, get_int_type(), and CgenState::module_.

31  {
32  auto& ctx = cgen_state->context_;
33  const auto pi8_type = llvm::PointerType::get(get_int_type(8, ctx), 0);
34  const auto ppi8_type = llvm::PointerType::get(pi8_type, 0);
35  const auto pi64_type = llvm::PointerType::get(get_int_type(64, ctx), 0);
36  const auto ppi64_type = llvm::PointerType::get(pi64_type, 0);
37  const auto i32_type = get_int_type(32, ctx);
38 
39  const auto func_type = llvm::FunctionType::get(
40  i32_type, {ppi8_type, pi64_type, ppi64_type, pi64_type}, false);
41 
42  auto func = llvm::Function::Create(func_type,
43  llvm::Function::ExternalLinkage,
44  "call_table_function",
45  cgen_state->module_);
46  auto arg_it = func->arg_begin();
47  const auto input_cols_arg = &*arg_it;
48  input_cols_arg->setName("input_col_buffers");
49  const auto input_row_count = &*(++arg_it);
50  input_row_count->setName("input_row_count");
51  const auto output_buffers = &*(++arg_it);
52  output_buffers->setName("output_buffers");
53  const auto output_row_count = &*(++arg_it);
54  output_row_count->setName("output_row_count");
55  return func;
56 }
llvm::Type * get_int_type(const int width, llvm::LLVMContext &context)
llvm::Module * module_
Definition: CgenState.h:264
llvm::LLVMContext & context_
Definition: CgenState.h:267

+ Here is the call graph for this function: