OmniSciDB  dfae7c3b14
anonymous_namespace{ResultSetReductionInterpreter.cpp} Namespace Reference

Functions

std::vector< Typeget_value_types (const std::vector< const Value *> &values)
 
size_t get_element_size (const Type element_type)
 
ReductionInterpreter::EvalValue eval_constant (const Constant *constant)
 

Function Documentation

◆ eval_constant()

ReductionInterpreter::EvalValue anonymous_namespace{ResultSetReductionInterpreter.cpp}::eval_constant ( const Constant constant)

Definition at line 409 of file ResultSetReductionInterpreter.cpp.

References CHECK, Double, logger::FATAL, Float, Int32, Int64, Int8, LOG, ReductionInterpreterImpl::ret(), ReductionInterpreter::run(), run, and Value::type().

409  {
410  switch (constant->type()) {
411  case Type::Int8:
412  case Type::Int32:
413  case Type::Int64: {
414  return {.int_val = static_cast<const ConstantInt*>(constant)->value()};
415  }
416  case Type::Float: {
417  return {.float_val =
418  static_cast<float>(static_cast<const ConstantFP*>(constant)->value())};
419  }
420  case Type::Double: {
421  return {.double_val = static_cast<const ConstantFP*>(constant)->value()};
422  }
423  default: {
424  LOG(FATAL) << "Constant type not supported: " << static_cast<int>(constant->type());
425  break;
426  }
427  }
428  return {};
429 }
#define LOG(tag)
Definition: Logger.h:188
Type type() const
+ Here is the call graph for this function:

◆ get_element_size()

size_t anonymous_namespace{ResultSetReductionInterpreter.cpp}::get_element_size ( const Type  element_type)

Definition at line 36 of file ResultSetReductionInterpreter.cpp.

References logger::FATAL, Int64PtrPtr, Int8Ptr, and LOG.

Referenced by Fragmenter_Namespace::InsertOrderFragmenter::compactRows(), ReductionInterpreterImpl::runAlloca(), ReductionInterpreterImpl::runGetElementPtr(), Fragmenter_Namespace::InsertOrderFragmenter::updateColumn(), and Fragmenter_Namespace::InsertOrderFragmenter::vacuum_fixlen_rows().

36  {
37  switch (element_type) {
38  case Type::Int8Ptr: {
39  return sizeof(int8_t);
40  }
41  case Type::Int64PtrPtr: {
42  return sizeof(int64_t*);
43  }
44  default: {
45  LOG(FATAL) << "Base pointer type not supported: " << static_cast<int>(element_type);
46  break;
47  }
48  }
49  return 0;
50 }
#define LOG(tag)
Definition: Logger.h:188
+ Here is the caller graph for this function:

◆ get_value_types()

std::vector<Type> anonymous_namespace{ResultSetReductionInterpreter.cpp}::get_value_types ( const std::vector< const Value *> &  values)

Definition at line 25 of file ResultSetReductionInterpreter.cpp.

Referenced by ReductionInterpreterImpl::bindStub(), and ReductionInterpreterImpl::runExternalCall().

25  {
26  std::vector<Type> value_types;
27  value_types.reserve(value_types.size());
28  std::transform(values.begin(),
29  values.end(),
30  std::back_inserter(value_types),
31  [](const Value* value) { return value->type(); });
32  return value_types;
33 }
+ Here is the caller graph for this function: