From a805ebc9a72cd8398529f92ecc117051e3e74195 Mon Sep 17 00:00:00 2001 From: Vasily Chekalkin Date: Tue, 3 May 2011 07:54:20 +1000 Subject: [PATCH] Add NULL and NEED_CONTINUATION definisions --- compilers/opsc/src/Ops/JIT.pm | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/compilers/opsc/src/Ops/JIT.pm b/compilers/opsc/src/Ops/JIT.pm index dc83b0aec4..0fb30effc7 100644 --- a/compilers/opsc/src/Ops/JIT.pm +++ b/compilers/opsc/src/Ops/JIT.pm @@ -280,6 +280,15 @@ method _create_jitted_function (%jit_context, $start) { %jit_context := $!module.get_global(:name); + # NULL isn't variable. But treat it as variable simplify life. + %jit_context := LLVM::Constant::null(LLVM::Type::pointer(LLVM::Type::void())); + + # It's actually macro, but Preprocessor supports only "function" macros. + %jit_context := LLVM::Constant::int_to_ptr( + LLVM::Constant::integer(1), + LLVM::Type::PMC_PTR(), + ); + # Create default return. $!debug && say("# default leave"); $!builder.set_position($leave);