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

Method ToReadWriteInfo

be/src/codegen/codegen-anyval.cc:1020–1052  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1018}
1019
1020CodegenAnyValReadWriteInfo CodegenAnyVal::ToReadWriteInfo() {
1021 llvm::IRBuilderBase::InsertPoint ip = builder_->saveIP();
1022
1023 llvm::LLVMContext& context = codegen_->context();
1024 llvm::Function* fn = builder_->GetInsertBlock()->getParent();
1025
1026 CodegenAnyValReadWriteInfo res(codegen_, builder_, type_);
1027
1028 llvm::BasicBlock* entry_block = llvm::BasicBlock::Create(context, "entry", fn);
1029 builder_->SetInsertPoint(entry_block);
1030
1031 // Create new basic blocks and branch instruction
1032 llvm::BasicBlock* non_null_block = llvm::BasicBlock::Create(context, "non_null", fn);
1033 llvm::BasicBlock* null_block = llvm::BasicBlock::Create(context, "null", fn);
1034 llvm::Value* is_null = GetIsNull();
1035 builder_->CreateCondBr(is_null, null_block, non_null_block);
1036
1037 builder_->SetInsertPoint(non_null_block);
1038 if (type_.IsStructType()) {
1039 StructToReadWriteInfo(&res, GetPtr());
1040 } else if (type_.IsStringType() || type_.IsCollectionType()) {
1041 res.SetPtrAndLen(GetPtr(), GetLen());
1042 } else if (type_.type == TYPE_TIMESTAMP) {
1043 res.SetTimeAndDate(GetTimeOfDay(), GetDate());
1044 } else {
1045 res.SetSimpleVal(GetVal());
1046 }
1047
1048 res.SetBlocks(entry_block, null_block, non_null_block);
1049
1050 builder_->restoreIP(ip);
1051 return res;
1052}
1053
1054void CodegenAnyVal::StructChildToReadWriteInfo(
1055 CodegenAnyValReadWriteInfo* read_write_info,

Callers 7

CodegenEvalChildrenMethod · 0.80
CodegenEvalRowMethod · 0.80
CodegenEvalMethod · 0.80
CodegenInsertMethod · 0.80
CodegenHashRowMethod · 0.80

Calls 10

CreateClass · 0.85
contextMethod · 0.80
getParentMethod · 0.80
IsStructTypeMethod · 0.80
IsStringTypeMethod · 0.80
IsCollectionTypeMethod · 0.80
SetPtrAndLenMethod · 0.80
SetTimeAndDateMethod · 0.80
SetSimpleValMethod · 0.80
SetBlocksMethod · 0.80

Tested by

no test coverage detected