mkql_computation_node_holders_codegen.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. #pragma once
  2. #include "mkql_computation_node_holders.h"
  3. #ifndef MKQL_DISABLE_CODEGEN
  4. namespace llvm {
  5. class Value;
  6. class BasicBlock;
  7. }
  8. #endif
  9. namespace NKikimr {
  10. namespace NMiniKQL {
  11. class TMemoryUsageInfo;
  12. #ifndef MKQL_DISABLE_CODEGEN
  13. struct TCodegenContext;
  14. #endif
  15. struct TContainerCacheOnContext : private TNonCopyable {
  16. TContainerCacheOnContext(TComputationMutables& mutables);
  17. NUdf::TUnboxedValuePod NewArray(TComputationContext& ctx, ui64 size, NUdf::TUnboxedValue*& items) const;
  18. #ifndef MKQL_DISABLE_CODEGEN
  19. llvm::Value* GenNewArray(ui64 sz, llvm::Value* items, const TCodegenContext& ctx, llvm::BasicBlock*& block) const;
  20. #endif
  21. const ui32 Index;
  22. };
  23. //////////////////////////////////////////////////////////////////////////////
  24. // TNodeFactory
  25. //////////////////////////////////////////////////////////////////////////////
  26. class TNodeFactory: private TNonCopyable
  27. {
  28. public:
  29. TNodeFactory(TMemoryUsageInfo& memInfo, TComputationMutables& mutables);
  30. IComputationNode* CreateTypeNode(TType* type) const;
  31. IComputationNode* CreateImmutableNode(NUdf::TUnboxedValue&& value) const;
  32. IComputationNode* CreateEmptyNode() const;
  33. IComputationNode* CreateArrayNode(TComputationNodePtrVector&& items) const;
  34. IComputationNode* CreateOptionalNode(IComputationNode* item) const;
  35. IComputationNode* CreateDictNode(
  36. std::vector<std::pair<IComputationNode*, IComputationNode*>>&& items,
  37. const TKeyTypes& types, bool isTuple, TType* encodedType,
  38. NUdf::IHash::TPtr hash, NUdf::IEquate::TPtr equate, NUdf::ICompare::TPtr compare, bool isSorted) const;
  39. IComputationNode* CreateVariantNode(IComputationNode* item, ui32 index) const;
  40. private:
  41. TMemoryUsageInfo& MemInfo;
  42. TComputationMutables& Mutables;
  43. };
  44. } // namespace NMiniKQL
  45. } // namespace NKikimr