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

Method GetCodegendComputeFnImpl

be/src/exprs/null-literal.cc:113–128  ·  view source on GitHub ↗

Generated IR for a bigint NULL literal: define { i8, i64 } @NullLiteral( %"class.impala::ScalarExprEvaluator"* %eval, %"class.impala::TupleRow"* %row) { entry: ret { i8, i64 } { i8 1, i64 0 } }

Source from the content-addressed store, hash-verified

111// ret { i8, i64 } { i8 1, i64 0 }
112// }
113Status NullLiteral::GetCodegendComputeFnImpl(LlvmCodeGen* codegen, llvm::Function** fn) {
114 DCHECK_EQ(GetNumChildren(), 0);
115 llvm::Value* args[2];
116 *fn = CreateIrFunctionPrototype("NullLiteral", codegen, &args);
117 llvm::BasicBlock* entry_block =
118 llvm::BasicBlock::Create(codegen->context(), "entry", *fn);
119 LlvmBuilder builder(entry_block);
120
121 llvm::Value* v = CodegenAnyVal::GetNullVal(codegen, type());
122 builder.CreateRet(v);
123 *fn = codegen->FinalizeFunction(*fn);
124 if (UNLIKELY(*fn == nullptr)) {
125 return Status(TErrorCode::IR_VERIFY_FAILED, "NullLiteral");
126 }
127 return Status::OK();
128}
129
130string NullLiteral::DebugString() const {
131 stringstream out;

Callers

nothing calls this directly

Calls 6

CreateClass · 0.85
OKFunction · 0.85
contextMethod · 0.80
FinalizeFunctionMethod · 0.80
StatusClass · 0.70
typeEnum · 0.50

Tested by

no test coverage detected