@@ -42,7 +42,7 @@ impl JIT {
4242 pub fn compile ( & mut self , input : & str ) -> Result < * const u8 , String > {
4343 // First, parse the string, producing AST nodes.
4444 let ( name, params, the_return, stmts) =
45- parser:: function ( & input) . map_err ( |e| e. to_string ( ) ) ?;
45+ parser:: function ( input) . map_err ( |e| e. to_string ( ) ) ?;
4646
4747 // Then, translate the AST nodes into Cranelift IR.
4848 self . translate ( params, the_return, stmts) ?;
@@ -64,7 +64,12 @@ impl JIT {
6464 // defined. For this toy demo for now, we'll just finalize the
6565 // function below.
6666 self . module
67- . define_function ( id, & mut self . ctx , & mut codegen:: binemit:: NullTrapSink { } )
67+ . define_function (
68+ id,
69+ & mut self . ctx ,
70+ & mut codegen:: binemit:: NullTrapSink { } ,
71+ & mut codegen:: binemit:: NullStackMapSink { } ,
72+ )
6873 . map_err ( |e| e. to_string ( ) ) ?;
6974
7075 // Now that compilation is finished, we can clear out the context state.
@@ -427,15 +432,15 @@ fn declare_variables_in_stmt(
427432 }
428433 Expr :: IfElse ( ref _condition, ref then_body, ref else_body) => {
429434 for stmt in then_body {
430- declare_variables_in_stmt ( int, builder, variables, index, & stmt) ;
435+ declare_variables_in_stmt ( int, builder, variables, index, stmt) ;
431436 }
432437 for stmt in else_body {
433- declare_variables_in_stmt ( int, builder, variables, index, & stmt) ;
438+ declare_variables_in_stmt ( int, builder, variables, index, stmt) ;
434439 }
435440 }
436441 Expr :: WhileLoop ( ref _condition, ref loop_body) => {
437442 for stmt in loop_body {
438- declare_variables_in_stmt ( int, builder, variables, index, & stmt) ;
443+ declare_variables_in_stmt ( int, builder, variables, index, stmt) ;
439444 }
440445 }
441446 _ => ( ) ,
0 commit comments