From 5313db710b668bb20c8573a5f7ed40718658bb98 Mon Sep 17 00:00:00 2001 From: Jonas Maebe Date: Wed, 15 Jun 2016 18:31:58 +0000 Subject: [PATCH] * override gen_stack_check_size_para() and gen_stack_check_call() for llvm and do nothing (see comments in the code) git-svn-id: trunk@33991 - --- compiler/llvm/hlcgllvm.pas | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/compiler/llvm/hlcgllvm.pas b/compiler/llvm/hlcgllvm.pas index b54e56e571..58a56eb49c 100644 --- a/compiler/llvm/hlcgllvm.pas +++ b/compiler/llvm/hlcgllvm.pas @@ -131,6 +131,8 @@ uses procedure g_intf_wrapper(list: TAsmList; procdef: tprocdef; const labelname: string; ioffset: longint); override; procedure g_adjust_self_value(list: TAsmList; procdef: tprocdef; ioffset: aint); override; procedure g_local_unwind(list: TAsmList; l: TAsmLabel); override; + procedure gen_stack_check_size_para(list: TAsmList); override; + procedure gen_stack_check_call(list: TAsmList); override; procedure varsym_set_localloc(list: TAsmList; vs: tabstractnormalvarsym); override; procedure paravarsym_set_initialloc_to_paraloc(vs: tparavarsym); override; @@ -1652,6 +1654,25 @@ implementation end; + procedure thlcgllvm.gen_stack_check_size_para(list: TAsmList); + begin + { this is implemented in a very hackish way, whereby first the call + to fpc_stackcheck() is emitted, then the prolog is generated and + registers are allocated, and finally the code to load the parameter + is inserted before the call to fpc_stackcheck(). Since parameters are + explicitly passed to call instructions for llvm, that does not work + here. It could be solved by patching the call instruction later, but + that's a lot of engineering for functionality that's only marginally + useful at best. + end; + + + procedure thlcgllvm.gen_stack_check_call(list: TAsmList); + begin + { see explanation in thlcgllvm.gen_stack_check_size_para() } + end; + + function thlcgllvm.make_simple_ref(list: TAsmList; const ref: treference; def: tdef): treference; begin result:=make_simple_ref_ptr(list,ref,cpointerdef.create(def));