4#ifndef OPENVDB_AX_CODEGEN_CODECS_HAS_BEEN_INCLUDED
5#define OPENVDB_AX_CODEGEN_CODECS_HAS_BEEN_INCLUDED
8#include <openvdb/version.h>
23using CodecTypeMap = std::map<const ast::tokens::CoreType, CodecNameMap>;
24using Codecs = std::vector<const Codec*>;
53 OPENVDB_ASSERT(mEncoder->list().size() == mDecoder->list().size());
54 for ([[maybe_unused]]
const auto& F : mEncoder->list()) {
74 llvm::Type* ret = findReturnTypeFromArg(this->
encoder(), type->getPointerTo());
75 return ret ? ret->getPointerElementType() :
nullptr;
90 if (!in->isPointerTy()) in = in->getPointerTo();
91 llvm::Type* ret = findReturnTypeFromArg(this->
decoder(), in);
92 return ret ? ret->getPointerElementType() :
nullptr;
97 inline uint32_t
flag()
const {
return mFlag; }
104 const uint32_t mFlag;
#define OPENVDB_ASSERT(X)
Definition Assert.h:41
Contains frameworks for creating custom AX functions which can be registered within the FunctionRegis...
Various function and operator tokens used throughout the AST and code generation.
Codec(codegen::FunctionGroup::UniquePtr encoder, codegen::FunctionGroup::UniquePtr decoder, uint32_t flag)
Definition Codecs.h:44
llvm::Type * encodedToDecoded(llvm::Type *in) const
Given a llvm type, return a compatible llvm type which represents how the provided type should be exp...
Definition Codecs.h:85
llvm::Type * decodedToEncoded(const ast::tokens::CoreType &in, llvm::LLVMContext &C) const
Given a core type supported by the AX frontend, return a llvm compatible type which represents how th...
Definition Codecs.h:65
const codegen::FunctionGroup * encoder() const
Definition Codecs.h:95
const codegen::FunctionGroup * decoder() const
Definition Codecs.h:96
std::unique_ptr< Codec > UniquePtr
Definition Codecs.h:42
uint32_t flag() const
Definition Codecs.h:97
CoreType
Definition Tokens.h:32
std::map< const ast::tokens::CoreType, CodecNameMap > CodecTypeMap
Definition Codecs.h:23
OPENVDB_AX_API const CodecNameMap * getTypeSupportedCodecs(const ast::tokens::CoreType type)
Get a specific set of codecs which encode a given type. Returns a nullptr if no codec exists.
OPENVDB_AX_API llvm::Type * llvmTypeFromToken(const ast::tokens::CoreType &type, llvm::LLVMContext &C)
Returns an llvm type representing a type defined by a string.
std::map< const std::string, const Codec * > CodecNameMap
Definition Codecs.h:22
OPENVDB_AX_API const CodecTypeMap & getCodecTypeMap()
Get the global codec map.
OPENVDB_AX_API const Codec * getCodec(const ast::tokens::CoreType type, const std::string &name)
Get a specific codec. Returns a nullptr if no codec exists.
std::vector< const Codec * > Codecs
Definition Codecs.h:24
Definition Exceptions.h:13
todo
Definition FunctionTypes.h:794
std::unique_ptr< FunctionGroup > UniquePtr
Definition FunctionTypes.h:796
#define OPENVDB_VERSION_NAME
The version namespace name for this library version.
Definition version.h.in:121
#define OPENVDB_USE_VERSION_NAMESPACE
Definition version.h.in:218