OmniSciDB  1dac507f6e
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ResultSetReductionInterpreterStubs.cpp File Reference
+ Include dependency graph for ResultSetReductionInterpreterStubs.cpp:

Go to the source code of this file.

Namespaces

 anonymous_namespace{ResultSetReductionInterpreterStubs.cpp}
 

Functions

llvm::Function * anonymous_namespace{ResultSetReductionInterpreterStubs.cpp}::create_stub_function (const std::string &name, CgenState *cgen_state)
 
std::string anonymous_namespace{ResultSetReductionInterpreterStubs.cpp}::get_stub_read_argument_name (const Type arg_type)
 
bool is_integer_type (const Type type)
 
bool is_pointer_type (const Type type)
 
int64_t read_stub_arg_int (const void *inputs_handle, const int32_t i)
 
float read_stub_arg_float (const void *inputs_handle, const int32_t i)
 
double read_stub_arg_double (const void *inputs_handle, const int32_t i)
 
const void * read_stub_arg_pvoid (const void *inputs_handle, const int32_t i)
 
const int8_t * read_stub_arg_pi8 (const void *inputs_handle, const int32_t i)
 
const int32_t * read_stub_arg_pi32 (const void *inputs_handle, const int32_t i)
 
const int32_t * read_stub_arg_pi64 (const void *inputs_handle, const int32_t i)
 
const int64_t *const * read_stub_arg_ppi64 (const void *inputs_handle, const int32_t i)
 
void write_stub_result_int (void *output_handle, const int64_t int_val)
 

Function Documentation

bool is_integer_type ( const Type  type)

Definition at line 84 of file ResultSetReductionInterpreterStubs.cpp.

References Int1, Int32, Int64, and Int8.

Referenced by StubGenerator::generateStub(), ReductionInterpreterImpl::runAlloca(), ReductionInterpreterImpl::runBinaryOperator(), ReductionInterpreterImpl::runCast(), ReductionInterpreterImpl::runFor(), ReductionInterpreterImpl::runICmp(), and ReductionInterpreterImpl::runMemCpy().

84  {
85  switch (type) {
86  case Type::Int1:
87  case Type::Int8:
88  case Type::Int32:
89  case Type::Int64: {
90  return true;
91  }
92  default: {
93  return false;
94  }
95  }
96 }

+ Here is the caller graph for this function:

bool is_pointer_type ( const Type  type)

Definition at line 98 of file ResultSetReductionInterpreterStubs.cpp.

References DoublePtr, FloatPtr, Int32Ptr, Int64Ptr, Int64PtrPtr, Int8Ptr, and VoidPtr.

Referenced by StubGenerator::generateStub(), ReductionInterpreterImpl::runCast(), ReductionInterpreterImpl::runLoad(), and ReductionInterpreterImpl::runMemCpy().

98  {
99  switch (type) {
100  case Type::Int8Ptr:
101  case Type::Int32Ptr:
102  case Type::Int64Ptr:
103  case Type::FloatPtr:
104  case Type::DoublePtr:
105  case Type::VoidPtr:
106  case Type::Int64PtrPtr: {
107  return true;
108  }
109  default: {
110  return false;
111  }
112  }
113 }

+ Here is the caller graph for this function:

double read_stub_arg_double ( const void *  inputs_handle,
const int32_t  i 
)

Definition at line 130 of file ResultSetReductionInterpreterStubs.cpp.

References CHECK_LT.

130  {
131  const auto& inputs = *reinterpret_cast<const StubGenerator::InputsType*>(inputs_handle);
132  CHECK_LT(static_cast<size_t>(i), inputs.size());
133  return inputs[i].double_val;
134 }
std::vector< ReductionInterpreter::EvalValue > InputsType
#define CHECK_LT(x, y)
Definition: Logger.h:200
float read_stub_arg_float ( const void *  inputs_handle,
const int32_t  i 
)

Definition at line 124 of file ResultSetReductionInterpreterStubs.cpp.

References CHECK_LT.

124  {
125  const auto& inputs = *reinterpret_cast<const StubGenerator::InputsType*>(inputs_handle);
126  CHECK_LT(static_cast<size_t>(i), inputs.size());
127  return inputs[i].float_val;
128 }
std::vector< ReductionInterpreter::EvalValue > InputsType
#define CHECK_LT(x, y)
Definition: Logger.h:200
int64_t read_stub_arg_int ( const void *  inputs_handle,
const int32_t  i 
)

Definition at line 118 of file ResultSetReductionInterpreterStubs.cpp.

References CHECK_LT.

118  {
119  const auto& inputs = *reinterpret_cast<const StubGenerator::InputsType*>(inputs_handle);
120  CHECK_LT(static_cast<size_t>(i), inputs.size());
121  return inputs[i].int_val;
122 }
std::vector< ReductionInterpreter::EvalValue > InputsType
#define CHECK_LT(x, y)
Definition: Logger.h:200
const int32_t* read_stub_arg_pi32 ( const void *  inputs_handle,
const int32_t  i 
)

Definition at line 146 of file ResultSetReductionInterpreterStubs.cpp.

References read_stub_arg_pvoid().

146  {
147  return static_cast<const int32_t*>(read_stub_arg_pvoid(inputs_handle, i));
148 }
const void * read_stub_arg_pvoid(const void *inputs_handle, const int32_t i)

+ Here is the call graph for this function:

const int32_t* read_stub_arg_pi64 ( const void *  inputs_handle,
const int32_t  i 
)

Definition at line 150 of file ResultSetReductionInterpreterStubs.cpp.

References read_stub_arg_pvoid().

150  {
151  return static_cast<const int32_t*>(read_stub_arg_pvoid(inputs_handle, i));
152 }
const void * read_stub_arg_pvoid(const void *inputs_handle, const int32_t i)

+ Here is the call graph for this function:

const int8_t* read_stub_arg_pi8 ( const void *  inputs_handle,
const int32_t  i 
)

Definition at line 142 of file ResultSetReductionInterpreterStubs.cpp.

References read_stub_arg_pvoid().

142  {
143  return static_cast<const int8_t*>(read_stub_arg_pvoid(inputs_handle, i));
144 }
const void * read_stub_arg_pvoid(const void *inputs_handle, const int32_t i)

+ Here is the call graph for this function:

const int64_t* const* read_stub_arg_ppi64 ( const void *  inputs_handle,
const int32_t  i 
)

Definition at line 154 of file ResultSetReductionInterpreterStubs.cpp.

References read_stub_arg_pvoid().

155  {
156  return static_cast<const int64_t* const*>(read_stub_arg_pvoid(inputs_handle, i));
157 }
const void * read_stub_arg_pvoid(const void *inputs_handle, const int32_t i)

+ Here is the call graph for this function:

const void* read_stub_arg_pvoid ( const void *  inputs_handle,
const int32_t  i 
)

Definition at line 136 of file ResultSetReductionInterpreterStubs.cpp.

References CHECK_LT.

Referenced by read_stub_arg_pi32(), read_stub_arg_pi64(), read_stub_arg_pi8(), and read_stub_arg_ppi64().

136  {
137  const auto& inputs = *reinterpret_cast<const StubGenerator::InputsType*>(inputs_handle);
138  CHECK_LT(static_cast<size_t>(i), inputs.size());
139  return inputs[i].ptr;
140 }
std::vector< ReductionInterpreter::EvalValue > InputsType
#define CHECK_LT(x, y)
Definition: Logger.h:200

+ Here is the caller graph for this function:

void write_stub_result_int ( void *  output_handle,
const int64_t  int_val 
)

Definition at line 161 of file ResultSetReductionInterpreterStubs.cpp.

References ReductionInterpreter::EvalValue::int_val.

161  {
162  auto output = reinterpret_cast<ReductionInterpreter::EvalValue*>(output_handle);
163  output->int_val = int_val;
164 }