adam-mcdaniel / oakc

A portable programming language with a compact intermediate representation
Apache License 2.0
728 stars 21 forks source link

Include needs to be moved to TIR #68

Closed adam-mcdaniel closed 4 years ago

adam-mcdaniel commented 4 years ago

Right now, there are some problems with including structures from other files. Calculating whether or not a structure is movable is determined in TIR, but that requires knowing whether or not the members of the structure are movable. If the type of a member of a structure is defined in another included file, this cannot be calculated: the inclusion is done in HIR after the mobility is calculated.

To fix this, the include directive must be computed in TIR before any TIR declarations are lowered to HIR. I have a fix for this I'm getting ready to push, I'm just checking for correctness.

adam-mcdaniel commented 4 years ago

Fixed with PR #74