1 ! Copyright (C) 2009 Matthew Willis.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: accessors alien.c-types alien.data alien.syntax
4 destructors kernel llvm.core llvm.engine llvm.jit llvm.wrappers
9 : buffer>module ( buffer -- module )
11 value>> f void* <ref> f void* <ref>
12 [ LLVMParseBitcode drop ] 2keep
13 void* deref [ llvm-throw ] when* void* deref
14 module new swap >>value
17 : load-module ( path -- module )
18 <buffer> buffer>module ;
20 : load-into-jit ( path name -- )
21 [ load-module ] dip add-module ;