[Info-vax] Ada on VMS, was: Re: Free Pascal for VMS ?

John Reagan xyzzy1959 at gmail.com
Sun May 13 22:08:40 EDT 2018


On Sunday, May 13, 2018 at 8:29:14 PM UTC-4, Simon Clubley wrote:

> 
> In fact the LLVM IR has had issues in the past with the nested
> functions you find in the Wirth style languages. I don't know if
> this is a solved problem (I thought it was) or if John is going
> to hit this when he ports Pascal.
> 
> I know we have talked about nested functions in LLVM in the past
> but a quick Google search couldn't find the discussion.
> 

The interesting areas are 

- uplevel addressing and dealing with static links.  While there is no builtin support for uplevel addressing, the solution is relatively straightforward as long as you can get the order-of-processing for the routines to be in the right order so you know the offsets of the outer level variables (or the saved static link in the routine above you on the stack).  Others have put Pascal-like frontends on LLVM before and I've already received some implementation tips.

- Non-local GOTOs to outer levels.  We have system services like SYS$GOTO_UNWIND64 that do the job and from LLVM's point of view, it isn't much different than setjmp/longjmp

- Bound procedure variables.  Again, you need to get able to get your hand on the stack links that you created/saved and create something to call as a bound-procedure (think 'trampoline').  On Alpha and Itanium, we were able to create procedure descriptors and routines like OTS$PROC_CALL to do that.  On x86, the address of a routine is the address of the first instruction (just the VAX days) so the trampoline will have to be created dynamically (yes, we've already been working on that design and any security issues related to them).  





More information about the Info-vax mailing list