Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make some initial fixes get core compiling #137

Merged
merged 1 commit into from
Jan 30, 2025

Conversation

iamrecursion
Copy link
Collaborator

Summary

This commit is a grab-bag of smaller fixes required to get Rust's core library compiling properly by hieratika. They include:

  • Adding support for an i48 type which seems to be required, as well as adding polyfill stubs for such a type.
  • Adding support for an i40 type which seems to be required, as well as adding polyfill stubs for such a type.
  • Changing the DataLayout type's query functionality to comply with the layout promotion rules for integers.
  • Registers all variables inside a function ahead of time to cope with usages before declaration in lexical order but not in execution order.
  • Changes the handling of GetElementPtr instructions to account for negative indices, which were not apparently allowed from the LangRef, but are encountered in core. As GetElementPtr does not access memory, it does make sense that they are allowed, so we now support them here.

Details

Just the usual checks, please!

Checklist

  • Code is formatted by Rustfmt or scarb fmt.
  • Documentation has been updated if necessary.

@iamrecursion iamrecursion added the enhancement New feature or request label Jan 29, 2025
@iamrecursion iamrecursion self-assigned this Jan 29, 2025
@iamrecursion iamrecursion requested a review from a team as a code owner January 29, 2025 20:17
@iamrecursion iamrecursion force-pushed the wip/ara/compiling-core branch from 729619f to 63b5b11 Compare January 29, 2025 20:28
@Eagle941
Copy link
Contributor

LGTM!

This commit is a grab-bag of smaller fixes required to get Rust's
`core` library compiling properly by hieratika. They include:

- Adding support for an `i48` type which seems to be required, as well
  as adding polyfill stubs for such a type.
- Adding support for an `i40` type which seems to be required, as well
  as adding polyfill stubs for such a type.
- Changing the `DataLayout` type's query functionality to comply with
  the layout promotion rules for integers.
- Registers all variables inside a function ahead of time to cope with
  usages before declaration in lexical order but not in execution order.
- Changes the handling of GetElementPtr instructions to account for
  negative indices, which were not apparently allowed from the LangRef,
  but are encountered in `core`. As GetElementPtr does not access
  memory, it does make sense that they are allowed, so we now support
  them here.
@iamrecursion iamrecursion force-pushed the wip/ara/compiling-core branch from 63b5b11 to 1714f13 Compare January 29, 2025 22:28
@iamrecursion iamrecursion merged commit 3a774f1 into main Jan 30, 2025
10 checks passed
@iamrecursion iamrecursion deleted the wip/ara/compiling-core branch January 30, 2025 20:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants