21 namespace spatial_type {
27 :
Codegen(geo_operator, catalog) {}
29 size_t size() const final {
return 1; }
43 const auto& geo_ti = col_var->get_type_info();
44 CHECK(geo_ti.is_geometry());
48 const auto ring_sizes_column_id = col_var->get_column_id() + 2;
53 operand_owned_ = std::make_unique<Analyzer::ColumnVar>(ring_sizes_cd->columnType,
54 col_var->get_table_id(),
56 col_var->get_rte_idx());
62 const std::vector<llvm::Value*>& arg_lvs,
63 const std::vector<llvm::Value*>& pos_lvs,
67 auto& argument_lv = arg_lvs.front();
68 std::string fn_name(
"array_size");
71 std::vector<llvm::Value*> array_size_args{
74 cgen_state->llInt(
log2_bytes(elem_ti.get_logical_size()))};
79 fn_name +=
"_nullable";
80 array_size_args.push_back(cgen_state->inlineIntNull(
getTypeInfo()));
82 const auto total_num_rings_lv = cgen_state->emitExternalCall(
83 fn_name,
get_int_type(32, cgen_state->context_), array_size_args);
84 return std::make_tuple(std::vector<llvm::Value*>{total_num_rings_lv},
88 std::vector<llvm::Value*>
codegen(
const std::vector<llvm::Value*>&
args,
94 CHECK(nullcheck_codegen);
95 return {nullcheck_codegen->finalize(cgen_state->inlineIntNull(
getTypeInfo()),
98 return {
args.front()};
class for a per-database catalog. also includes metadata for the current database and the current use...
llvm::Type * get_int_type(const int width, llvm::LLVMContext &context)
std::tuple< std::vector< llvm::Value * >, llvm::Value * > codegenLoads(const std::vector< llvm::Value * > &arg_lvs, const std::vector< llvm::Value * > &pos_lvs, CgenState *cgen_state) final
NRings(const Analyzer::GeoOperator *geo_operator, const Catalog_Namespace::Catalog *catalog)
size_t size() const final
const Catalog_Namespace::Catalog * cat_
const SQLTypeInfo & get_type_info() const
SQLTypeInfo getNullType() const final
const Analyzer::GeoOperator * operator_
Analyzer::Expr * getOperand(const size_t index) const
const Analyzer::Expr * getOperand(const size_t index) final
uint32_t log2_bytes(const uint32_t bytes)
std::vector< llvm::Value * > codegen(const std::vector< llvm::Value * > &args, CodeGenerator::NullCheckCodegen *nullcheck_codegen, CgenState *cgen_state, const CompilationOptions &co) final
SQLTypeInfo get_elem_type() const
const ColumnDescriptor * get_column_descriptor(const int col_id, const int table_id, const Catalog_Namespace::Catalog &cat)
std::unique_ptr< Analyzer::ColumnVar > operand_owned_