Skip to content
This repository was archived by the owner on May 9, 2024. It is now read-only.

Commit bff6bd4

Browse files
committed
Remove UDF specialization from get_buffer_struct_type
With opaque pointers we cannot rely on pointer introspection to sanity check UDF code. If this becomes a problem in the future we will need to register the struct type when we register the UDF and compare that way.
1 parent 1066c9c commit bff6bd4

File tree

1 file changed

+0
-31
lines changed

1 file changed

+0
-31
lines changed

omniscidb/QueryEngine/ExtensionsIR.cpp

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -44,37 +44,6 @@ llvm::StructType* get_buffer_struct_type(CgenState* cgen_state,
4444
cgen_state->context_,
4545
{elem_type, llvm::Type::getInt64Ty(cgen_state->context_)},
4646
false));
47-
llvm::Function* udf_func = cgen_state->module_->getFunction(ext_func_name);
48-
if (udf_func) {
49-
// Compare expected array struct type with type from the function
50-
// definition from the UDF module, but use the type from the
51-
// module
52-
llvm::FunctionType* udf_func_type = udf_func->getFunctionType();
53-
CHECK_LE(param_num, udf_func_type->getNumParams());
54-
llvm::Type* param_pointer_type = udf_func_type->getParamType(param_num);
55-
CHECK(param_pointer_type->isPointerTy());
56-
llvm::Type* param_type = param_pointer_type->getPointerElementType();
57-
CHECK(param_type->isStructTy());
58-
llvm::StructType* struct_type = llvm::cast<llvm::StructType>(param_type);
59-
CHECK_GE(struct_type->getStructNumElements(),
60-
generated_struct_type->getStructNumElements())
61-
<< serialize_llvm_object(struct_type);
62-
63-
const auto expected_elems = generated_struct_type->elements();
64-
const auto current_elems = struct_type->elements();
65-
for (size_t i = 0; i < expected_elems.size(); i++) {
66-
CHECK_EQ(expected_elems[i], current_elems[i])
67-
<< "[" << ::toString(expected_elems[i]) << ", " << ::toString(current_elems[i])
68-
<< "]";
69-
}
70-
71-
if (struct_type->isLiteral()) {
72-
return struct_type;
73-
}
74-
75-
llvm::StringRef struct_name = struct_type->getStructName();
76-
return struct_type->getTypeByName(cgen_state->context_, struct_name);
77-
}
7847
return generated_struct_type;
7948
}
8049

0 commit comments

Comments
 (0)