[M3devel] backend interface vs. types vs. forward references?

Jay K jay.krell at cornell.edu
Mon Oct 4 01:44:02 CEST 2010


I think I'll just solve this in the backend by making a few passes.
Maybe something with specific passes where early passes only pay
attention to certain opcodes, that declare types.

The new/current "replay" stuff will maybe go away.

The new/current keeping of the entire file in memory will stay
unless someone has strong evidence/argument that is shouldn't.

 - Jay

----------------------------------------
> From: jay.krell at cornell.edu
> To: m3devel at elegosoft.com
> Subject: backend interface vs. types vs. forward references?
> Date: Sun, 3 Oct 2010 12:47:41 +0000
>
>
> It appears that due to e.g.
>
>
> TYPE Pointer = REF Record;
> TYPE Record = RECORD
>     Next: Pointer;
> END;
>
>
> it is possible for the backend to get type declarations "out of order".
>   There being no "correct" order, no order without forward references.
> It says declare_indirect(Pointer) before declare_record(Record).
>   I'm not sure of this exact example, but it does occur.
>
>
> Currently fields are implicitly within the "current" record.
>
>
> I think in order to break these cycles, declare_field should contain the uid of their record.
>
>
> And then we should forward declare all records.
> Then indirects to them.
> Then their fields.
>
>
> I'm not sure that solves the general case or not though.
>
>
> More generally we might want to use this pattern also for objects and proctypes.
>
>
> It's also likely I can solve this in the backend alone, by running more passes
> until everything is resolved.
>
>
> I keep thinking to myself that I might have to build up in memory
> a very faithful rendition of the m3cg calls and iterate over it,
> before making the gcc trees.
>
>
> ?
>
>
>  - Jay
>
>
 		 	   		  


More information about the M3devel mailing list