MCPcopy Create free account
hub / github.com/apache/arrow / BuildParams

Method BuildParams

cpp/src/gandiva/llvm_generator.cc:1310–1353  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1308}
1309
1310std::vector<llvm::Value*> LLVMGenerator::Visitor::BuildParams(
1311 int holder_idx, const ValueValidityPairVector& args, bool with_validity,
1312 bool with_context) {
1313 std::vector<llvm::Value*> params;
1314
1315 // add context if required.
1316 if (with_context) {
1317 params.push_back(arg_context_ptr_);
1318 }
1319
1320 // if the function has holder, add the holder pointer.
1321 if (holder_idx != -1) {
1322 auto builder = ir_builder();
1323
1324 // Switch to the entry block and load the holder pointers
1325 llvm::BasicBlock* saved_block = builder->GetInsertBlock();
1326 builder->SetInsertPoint(entry_block_);
1327
1328 auto holder = generator_->LoadVectorAtIndex(
1329 arg_holder_ptrs_, generator_->types()->i64_type(), holder_idx, "holder");
1330
1331 builder->SetInsertPoint(saved_block);
1332 params.push_back(holder);
1333 }
1334
1335 // build the function params, along with the validities.
1336 for (auto& pair : args) {
1337 // build value.
1338 DexPtr value_expr = pair->value_expr();
1339 value_expr->Accept(*this);
1340 LValue& result_ref = *result();
1341
1342 // append all the parameters corresponding to this LValue.
1343 result_ref.AppendFunctionParams(&params);
1344
1345 // build validity.
1346 if (with_validity) {
1347 llvm::Value* validity_expr = BuildCombinedValidity(pair->validity_exprs());
1348 params.push_back(validity_expr);
1349 }
1350 }
1351
1352 return params;
1353}
1354
1355// Bitwise-AND of a vector of bits to get the combined validity.
1356llvm::Value* LLVMGenerator::Visitor::BuildCombinedValidity(const DexVector& validities) {

Callers

nothing calls this directly

Calls 6

resultFunction · 0.85
push_backMethod · 0.80
LoadVectorAtIndexMethod · 0.80
typesMethod · 0.80
ir_builderFunction · 0.70
AcceptMethod · 0.45

Tested by

no test coverage detected