MCPcopy Create free account
hub / github.com/apache/impala / GetLlvmStruct

Method GetLlvmStruct

be/src/runtime/descriptors.cc:1593–1612  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1591}
1592
1593llvm::StructType* TupleDescriptor::GetLlvmStruct(LlvmCodeGen* codegen) const {
1594 int curr_struct_offset = 0;
1595 auto struct_fields_and_offset = GetLlvmTypesAndOffset(codegen, curr_struct_offset);
1596 vector<llvm::Type*> struct_fields = struct_fields_and_offset.first;
1597 curr_struct_offset = struct_fields_and_offset.second;
1598
1599 // For each null byte, add a byte to the struct
1600 for (int i = 0; i < num_null_bytes_; ++i) {
1601 struct_fields.push_back(codegen->i8_type());
1602 ++curr_struct_offset;
1603 }
1604
1605 DCHECK_LE(curr_struct_offset, byte_size_);
1606 if (curr_struct_offset < byte_size_) {
1607 struct_fields.push_back(llvm::ArrayType::get(codegen->i8_type(),
1608 byte_size_ - curr_struct_offset));
1609 }
1610
1611 return CreateLlvmStructTypeFromFieldTypes(codegen, struct_fields, 0);
1612}
1613
1614pair<vector<llvm::Type*>, int> TupleDescriptor::GetLlvmTypesAndOffset(
1615 LlvmCodeGen* codegen, int curr_struct_offset) const {

Callers 7

CodegenUpdateSlotMethod · 0.80
CodegenUpdateTupleMethod · 0.80
CodegenWriteSlotMethod · 0.80

Calls 2

push_backMethod · 0.80
i8_typeMethod · 0.80

Tested by

no test coverage detected