#pragma once #include #include "mkql_llvm_base.h" #include namespace NKikimr::NMiniKQL { #ifndef MKQL_DISABLE_CODEGEN class TLLVMFieldsStructureBlockState: public TLLVMFieldsStructure> { private: using TBase = TLLVMFieldsStructure>; llvm::IntegerType*const CountType; llvm::PointerType*const PointerType; llvm::ArrayType*const SkipSpaceType; protected: using TBase::Context; static constexpr auto BaseFields = 3U; public: std::vector GetFieldsArray() { std::vector result = TBase::GetFields(); result.emplace_back(CountType); result.emplace_back(PointerType); result.emplace_back(SkipSpaceType); return result; } llvm::Constant* GetCount() { return llvm::ConstantInt::get(llvm::Type::getInt32Ty(Context), TBase::GetFieldsCount() + 0); } llvm::Constant* GetPointer() { return llvm::ConstantInt::get(llvm::Type::getInt32Ty(Context), TBase::GetFieldsCount() + 1); } TLLVMFieldsStructureBlockState(llvm::LLVMContext& context, size_t width) : TBase(context) , CountType(llvm::Type::getInt64Ty(Context)) , PointerType(llvm::PointerType::getUnqual(llvm::ArrayType::get(llvm::Type::getInt128Ty(Context), width))) , SkipSpaceType(llvm::ArrayType::get(llvm::Type::getInt64Ty(Context), 9U)) // Skip std::vectors Values & Arrays {} }; #endif } //namespace NKikimr::NMiniKQL