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

Method CodegenWriteStringToSlot

be/src/runtime/descriptors.cc:1394–1415  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1392}
1393
1394void 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
1417void SlotDescriptor::CodegenWriteCollectionItemsToSlot(LlvmCodeGen* codegen,
1418 LlvmBuilder* builder, llvm::Value* collection_value_ptr, llvm::Value* num_tuples,

Callers

nothing calls this directly

Calls 8

IsStringTypeMethod · 0.80
CodegenMemcpyMethod · 0.80
CreateCallMethod · 0.80
codegenMethod · 0.45
builderMethod · 0.45
typeMethod · 0.45
GetFunctionMethod · 0.45

Tested by

no test coverage detected