[M3devel] use of LLVM

Hendrik Boom hendrik at topoi.pooq.com
Tue May 22 17:56:51 CEST 2012


On Tue, May 22, 2012 at 10:45:24AM +0200, Henning Thielemann wrote:
> 
> On Mon, 21 May 2012, Hendrik Boom wrote:
> 
> >The problem I had with LLVM for Algol 68 was that I couldn't use a type
> >before it was completely defined.  THis means that there are stark
> >constraints on the use of incomplete types.  I wanted to build a
> >structure to represent a stack frame, containing local variables and
> >the like, and having the field offsets afailable for type descriptors
> >for the garbage collector.  But even though LLVM could have computed
> >field offsets along the way, as they were contributed to the structure,
> >instead it decided to diallow all use of the structure until its
> >definition was complete.  UNfortunately, I didn't know what all the
> >fields would be until I got to finish generating the code that used the
> >stack frame.
> 
> I thought that you can disable pointer type checking completely by
> using i8* and cast it forth and back as you need it.

But I still can't generate code that does anything more than mention 
these types until they are completely defined.  I can't make the 
abtstract syntax tree for sizeof(foo) before I've completed the 
definition of foo.  I can't mention any of the field names until I've 
completed the definition of foo....

Yes, i8* might get around some limitations, if I do all the field 
offset calculations myself and embed the numbers in the generated 
code.  But that's not how LLVM is supposed to work.  It's supposed to 
be rather more machine-independent than that.

-- hendrik



More information about the M3devel mailing list