diff options
author | vvvv <[email protected]> | 2024-11-07 04:19:26 +0300 |
---|---|---|
committer | vvvv <[email protected]> | 2024-11-07 04:29:50 +0300 |
commit | 2661be00f3bc47590fda9218bf0386d6355c8c88 (patch) | |
tree | 3d316c07519191283d31c5f537efc6aabb42a2f0 /yql/essentials/minikql/computation/mkql_computation_node_holders_codegen.h | |
parent | cf2a23963ac10add28c50cc114fbf48953eca5aa (diff) |
Moved yql/minikql YQL-19206
init
[nodiff:caesar]
commit_hash:d1182ef7d430ccf7e4d37ed933c7126d7bd5d6e4
Diffstat (limited to 'yql/essentials/minikql/computation/mkql_computation_node_holders_codegen.h')
-rw-r--r-- | yql/essentials/minikql/computation/mkql_computation_node_holders_codegen.h | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/yql/essentials/minikql/computation/mkql_computation_node_holders_codegen.h b/yql/essentials/minikql/computation/mkql_computation_node_holders_codegen.h new file mode 100644 index 00000000000..3c510319f70 --- /dev/null +++ b/yql/essentials/minikql/computation/mkql_computation_node_holders_codegen.h @@ -0,0 +1,62 @@ +#pragma once + +#include "mkql_computation_node_holders.h" + +#ifndef MKQL_DISABLE_CODEGEN +namespace llvm { + class Value; + class BasicBlock; +} +#endif + +namespace NKikimr { +namespace NMiniKQL { + +class TMemoryUsageInfo; + +#ifndef MKQL_DISABLE_CODEGEN +struct TCodegenContext; +#endif + +struct TContainerCacheOnContext : private TNonCopyable { + TContainerCacheOnContext(TComputationMutables& mutables); + + NUdf::TUnboxedValuePod NewArray(TComputationContext& ctx, ui64 size, NUdf::TUnboxedValue*& items) const; +#ifndef MKQL_DISABLE_CODEGEN + llvm::Value* GenNewArray(ui64 sz, llvm::Value* items, const TCodegenContext& ctx, llvm::BasicBlock*& block) const; +#endif + const ui32 Index; +}; + +////////////////////////////////////////////////////////////////////////////// +// TNodeFactory +////////////////////////////////////////////////////////////////////////////// +class TNodeFactory: private TNonCopyable +{ +public: + TNodeFactory(TMemoryUsageInfo& memInfo, TComputationMutables& mutables); + + IComputationNode* CreateTypeNode(TType* type) const; + + IComputationNode* CreateImmutableNode(NUdf::TUnboxedValue&& value) const; + + IComputationNode* CreateEmptyNode() const; + + IComputationNode* CreateArrayNode(TComputationNodePtrVector&& items) const; + + IComputationNode* CreateOptionalNode(IComputationNode* item) const; + + IComputationNode* CreateDictNode( + std::vector<std::pair<IComputationNode*, IComputationNode*>>&& items, + const TKeyTypes& types, bool isTuple, TType* encodedType, + NUdf::IHash::TPtr hash, NUdf::IEquate::TPtr equate, NUdf::ICompare::TPtr compare, bool isSorted) const; + + IComputationNode* CreateVariantNode(IComputationNode* item, ui32 index) const; + +private: + TMemoryUsageInfo& MemInfo; + TComputationMutables& Mutables; +}; + +} // namespace NMiniKQL +} // namespace NKikimr |