| 1392 | } |
| 1393 | |
| 1394 | void SlotDescriptor::CodegenWriteStringToSlot( |
| 1395 | const CodegenAnyValReadWriteInfo& read_write_info, |
| 1396 | llvm::Value* slot_ptr, llvm::Value* pool_val, const SlotDescriptor* slot_desc) { |
| 1397 | LlvmCodeGen* codegen = read_write_info.codegen(); |
| 1398 | LlvmBuilder* builder = read_write_info.builder(); |
| 1399 | const ColumnType& type = read_write_info.type(); |
| 1400 | DCHECK(type.IsStringType()); |
| 1401 | |
| 1402 | llvm::Value* ptr = read_write_info.GetPtrAndLen().ptr; |
| 1403 | llvm::Value* len = read_write_info.GetPtrAndLen().len; |
| 1404 | if (pool_val != nullptr) { |
| 1405 | // Allocate a 'new_ptr' from 'pool_val' and copy the data from 'read_write_info->ptr'. |
| 1406 | llvm::Value* new_ptr = codegen->CodegenMemPoolAllocate( |
| 1407 | builder, pool_val, len, "new_ptr"); |
| 1408 | codegen->CodegenMemcpy(builder, new_ptr, ptr, len); |
| 1409 | ptr = new_ptr; |
| 1410 | } |
| 1411 | llvm::Function* str_assign_fn = codegen->GetFunction( |
| 1412 | IRFunction::STRING_VALUE_ASSIGN, false); |
| 1413 | builder->CreateCall(str_assign_fn, |
| 1414 | llvm::ArrayRef<llvm::Value*>({slot_ptr, ptr, len})); |
| 1415 | } |
| 1416 | |
| 1417 | void SlotDescriptor::CodegenWriteCollectionItemsToSlot(LlvmCodeGen* codegen, |
| 1418 | LlvmBuilder* builder, llvm::Value* collection_value_ptr, llvm::Value* num_tuples, |
nothing calls this directly
no test coverage detected