| 1560 | } |
| 1561 | |
| 1562 | llvm::Value* SlotDescriptor::CodegenToTimestampValue( |
| 1563 | const CodegenAnyValReadWriteInfo& read_write_info) { |
| 1564 | const ColumnType& type = read_write_info.type(); |
| 1565 | DCHECK_EQ(type.type, TYPE_TIMESTAMP); |
| 1566 | // Convert TimestampVal to TimestampValue |
| 1567 | // TimestampValue has type |
| 1568 | // { boost::posix_time::time_duration, boost::gregorian::date } |
| 1569 | // = { {{{i64}}}, {{i32}} } |
| 1570 | llvm::Type* raw_type = read_write_info.codegen()->GetSlotType(type); |
| 1571 | llvm::Value* timestamp_value = llvm::Constant::getNullValue(raw_type); |
| 1572 | uint32_t time_of_day_idxs[] = {0, 0, 0, 0}; |
| 1573 | |
| 1574 | LlvmBuilder* builder = read_write_info.builder(); |
| 1575 | timestamp_value = builder->CreateInsertValue( |
| 1576 | timestamp_value, read_write_info.GetTimeAndDate().time_of_day, time_of_day_idxs); |
| 1577 | uint32_t date_idxs[] = {1, 0, 0}; |
| 1578 | timestamp_value = builder->CreateInsertValue( |
| 1579 | timestamp_value, read_write_info.GetTimeAndDate().date, date_idxs); |
| 1580 | return timestamp_value; |
| 1581 | } |
| 1582 | |
| 1583 | vector<SlotDescriptor*> TupleDescriptor::SlotsOrderedByIdx() const { |
| 1584 | vector<SlotDescriptor*> sorted_slots(slots().size()); |
nothing calls this directly
no test coverage detected