[M3devel] a "need" for multi-pass m3cg (or different order of calls)

Hendrik Boom hendrik at topoi.pooq.com
Fri Sep 7 20:21:02 CEST 2012


On Thu, Sep 06, 2012 at 08:40:46AM +0000, Jay K wrote:
> /* The following is legal C but not C++: */
> 
> struct Foo_t;typedef struct Foo_t Foo_t;static struct Foo_t Foo;
>   /* illegal C++; C forward/tentative definition */
> int F1(void) { return *(int*)&Foo; }
> struct Foo_t { int i; };static Foo_t Foo = { 123 };

The analogous problem in LLVM is why I couldn't use the LLV<-parse-tree 
building tools to generate LLVM code from Algol 68.

Which is kind of stupid, since it shouldn't actually *need* any of this 
type information until the parse tree is complete and it starts to 
generate code.  But it insists on having a completely defined type 
before it allows me to enter code involving it into the still-incomplete 
parse tree, which it's designed to let me sprout in any order I choose.

- hendrik



More information about the M3devel mailing list