| 1591 | } |
| 1592 | |
| 1593 | llvm::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 | |
| 1614 | pair<vector<llvm::Type*>, int> TupleDescriptor::GetLlvmTypesAndOffset( |
| 1615 | LlvmCodeGen* codegen, int curr_struct_offset) const { |
no test coverage detected