| 1581 | } |
| 1582 | |
| 1583 | vector<SlotDescriptor*> TupleDescriptor::SlotsOrderedByIdx() const { |
| 1584 | vector<SlotDescriptor*> sorted_slots(slots().size()); |
| 1585 | for (SlotDescriptor* slot: slots()) sorted_slots[slot->slot_idx_] = slot; |
| 1586 | // Check that the size of sorted_slots has not changed. This ensures that the series |
| 1587 | // of slot indexes starts at 0 and increases by 1 for each slot. This also ensures that |
| 1588 | // the returned vector has no nullptr elements. |
| 1589 | DCHECK_EQ(slots().size(), sorted_slots.size()); |
| 1590 | return sorted_slots; |
| 1591 | } |
| 1592 | |
| 1593 | llvm::StructType* TupleDescriptor::GetLlvmStruct(LlvmCodeGen* codegen) const { |
| 1594 | int curr_struct_offset = 0; |