sampsyo / bril

an educational compiler intermediate representation
https://capra.cs.cornell.edu/bril/
MIT License
557 stars 231 forks source link

Specify and check that the `@main` function can't have a return type #292

Closed sampsyo closed 1 year ago

sampsyo commented 1 year ago

As discussed in https://github.com/sampsyo/bril/pull/281#discussion_r1319112205 and previously in https://github.com/sampsyo/bril/issues/91, it seems like @main shouldn't return anything. (Maybe we will change this in the future—e.g., maybe it should be able to return an OS status code—but we can relax this requirement if we ever want to do that.)

This PR adds this requirement to the docs and adds the obvious check to brilck. The CI will fail on this PR until the benchmark from #281 is fixed to obey the new rule.

sampsyo commented 1 year ago

All set now, following #293!