Skip to content

Commit 287369c

Browse files
authored
Merge pull request #4 from t3tra-dev/chore/oob-check
2 parents 73f19f4 + ce11add commit 287369c

8 files changed

Lines changed: 1407 additions & 512 deletions

File tree

CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,13 @@ target_link_libraries(llvm-shared INTERFACE ${LLVM_SHARED_LIBRARIES})
5252

5353
add_library(libbfjit STATIC
5454
include/bfjit.h
55+
include/bfjit_internal.h
5556
include/bflexer.h
5657
include/bfopt.h
5758
include/bfparser.h
5859
src/bfjit.c
60+
src/bfjit_codegen.c
61+
src/bfjit_runtime.c
5962
src/bflexer.c
6063
src/bfopt.c
6164
src/bfparser.c

include/bfjit_internal.h

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#ifndef BFJIT_INTERNAL_H
2+
#define BFJIT_INTERNAL_H
3+
4+
#include "bfjit.h"
5+
6+
#include <llvm-c/Core.h>
7+
#include <llvm-c/Error.h>
8+
#include <llvm-c/LLJIT.h>
9+
#include <llvm-c/Orc.h>
10+
11+
void bf_jit_err_reset(bf_jit_err *err);
12+
void bf_set_jit_err(bf_jit_err *err, const char *msg);
13+
void bf_set_jit_err_from_llvm(bf_jit_err *err, LLVMErrorRef llvm_err);
14+
15+
LLVMModuleRef bf_build_module(LLVMContextRef ctx, const bf_program *program,
16+
bf_jit_err *err);
17+
int bf_opt_llvm_module(LLVMModuleRef mod, bf_jit_err *err);
18+
19+
LLVMOrcMaterializationUnitRef bf_create_io_symbols(LLVMOrcLLJITRef jit);
20+
21+
#endif

include/bfparser.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ typedef enum bf_ir_kind {
1313
BF_IR_OUTPUT,
1414
BF_IR_LOOP,
1515
BF_IR_SET_ZERO,
16+
BF_IR_SET_CONST,
17+
BF_IR_MULTI_ZERO,
1618
BF_IR_SCAN,
1719
BF_IR_MULTIPLY_LOOP
1820
} bf_ir_kind;

0 commit comments

Comments
 (0)