1
0
mirror of https://github.com/exaloop/codon.git synced 2025-06-03 15:03:52 +08:00
codon/codon/compiler/jit_extern.h
A. R. Shajii b8c1eeed36
2025 updates (#619)
* 2025 updates

* Update ci.yml
2025-01-29 15:41:43 -05:00

37 lines
972 B
C++

// Copyright (C) 2022-2025 Exaloop Inc. <https://exaloop.io>
#pragma once
#include <string>
#include <vector>
namespace codon {
namespace jit {
class JIT;
struct JITResult {
void *result;
std::string message;
operator bool() const { return message.empty(); }
static JITResult success(void *result) { return {result, ""}; }
static JITResult error(const std::string &message) { return {nullptr, message}; }
};
JIT *jitInit(const std::string &name);
JITResult jitExecutePython(JIT *jit, const std::string &name,
const std::vector<std::string> &types,
const std::string &pyModule,
const std::vector<std::string> &pyVars, void *arg,
bool debug);
JITResult jitExecuteSafe(JIT *jit, const std::string &code, const std::string &file,
int line, bool debug);
std::string getJITLibrary();
} // namespace jit
} // namespace codon