pslang/libs/jit/source/jit.cpp

30 lines
700 B
C++

#include <pslang/jit/jit.hpp>
#include <pslang/jit/arch/macos_aarch64/compiler.hpp>
#include <stdexcept>
namespace pslang::jit
{
void compile(program_context & pcontext, ir::module_context const & mcontext)
{
switch (pcontext.abi.platform)
{
case platform::linux:
throw std::runtime_error("Linux JIT compilation not supported");
case platform::windows:
throw std::runtime_error("Windows JIT compilation not supported");
case platform::macos:
switch (pcontext.abi.isa)
{
case isa::x86_64:
throw std::runtime_error("macOS x86_64 JIT compilation not supported");
case isa::aarch64:
macos_aarch64::compile(pcontext, mcontext);
break;
}
break;
}
}
}