[fpc-pascal] Argument evaluation order in Free Pascal and Delphi

Jonas Maebe jonas.maebe at elis.ugent.be
Tue Oct 29 14:56:28 CET 2013


On 29 Oct 2013, at 14:35, Michael Van Canneyt wrote:

>
>
> On Tue, 29 Oct 2013, Jonas Maebe wrote:
>
>> I think they use "evaluation order" as a synonym for "parameter  
>> passing order" on that page, given the table below: it says that  
>> the order in which the parameters are passed for register/pascal is  
>> undefined. That basically means that pure assembler routines using  
>> the register or pascal calling conventions are no longer supported  
>> in Delphi, since you can't know how the parameters are passed (or  
>> at least there are no guarantees about it).
>
> Probably a consequence of their adding a new llvm backend  
> architecture.

I also thought that at first, but on the other hand LLVM doesn't have  
any built-in support for "a calling convention that passes parameters  
in registers whereby the callee is responsible for the stack cleanup",  
and yet Embarcardero still advertises the "register" calling  
convention as doing exactly that (I guess as an alternative for  
"pascal", they can use stdcall since that one also passes everything  
on the stack and has callee-side cleanup iirc). If they added it  
themselves in a private LLVM branch, I don't understand why they  
didn't implement it in a way that was compatible with existing code.



Jonas



More information about the fpc-pascal mailing list