MCPcopy Create free account
hub / github.com/ClickHouse/ClickHouse / compileAdd

Method compileAdd

src/AggregateFunctions/AggregateFunctionCount.cpp:140–151  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

138}
139
140void AggregateFunctionCount::compileAdd(llvm::IRBuilderBase & builder, llvm::Value * aggregate_data_ptr, const ValuesWithType &) const
141{
142 llvm::IRBuilder<> & b = static_cast<llvm::IRBuilder<> &>(builder);
143
144 auto * return_type = toNativeType(b, this->getResultType());
145
146 auto * count_value_ptr = aggregate_data_ptr;
147 auto * count_value = b.CreateLoad(return_type, count_value_ptr);
148 auto * updated_count_value = b.CreateAdd(count_value, llvm::ConstantInt::get(return_type, 1));
149
150 b.CreateStore(updated_count_value, count_value_ptr);
151}
152
153void AggregateFunctionCount::compileMerge(llvm::IRBuilderBase & builder, llvm::Value * aggregate_data_dst_ptr, llvm::Value * aggregate_data_src_ptr) const
154{

Callers

nothing calls this directly

Calls 3

toNativeTypeFunction · 0.85
getFunction · 0.50
getResultTypeMethod · 0.45

Tested by

no test coverage detected