about summary refs log tree commit diff
path: root/src/codegen/mod.rs
diff options
context:
space:
mode:
authorGriffin Smith <root@gws.fyi>2021-03-08T05·04-0500
committerGriffin Smith <root@gws.fyi>2021-03-08T05·04-0500
commit1ea2d8ba9fef3bee2c757d19d8b42e541e3fe390 (patch)
tree6999d66bb363fce16a078abfc913fa1610c1437c /src/codegen/mod.rs
parent80f8ede0bbc9799d5199707e1e1ad8e80e4ca7ac (diff)
Implement functions, both top-level and anonymous
Implement both top-level and anonymous functions, but not closures in
either case.
Diffstat (limited to 'src/codegen/mod.rs')
-rw-r--r--src/codegen/mod.rs4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/codegen/mod.rs b/src/codegen/mod.rs
index 4620b6b48e84..6f95d90b45a1 100644
--- a/src/codegen/mod.rs
+++ b/src/codegen/mod.rs
@@ -14,9 +14,7 @@ pub fn jit_eval<T>(expr: &Expr) -> Result<T> {
         .module
         .create_jit_execution_engine(OptimizationLevel::None)
         .map_err(Error::from)?;
-    codegen.new_function("eval", context.i64_type().fn_type(&[], false));
-    let res = codegen.codegen_expr(&expr)?;
-    codegen.finish_function(&res);
+    codegen.codegen_function("test", &[], &expr)?;
 
     unsafe {
         let fun: JitFunction<unsafe extern "C" fn() -> T> =