Skip to content

Basic support for control flow (calls and returns without data) #445

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

Merged
merged 18 commits into from
Feb 4, 2025

Conversation

jberthold
Copy link
Member

  • Various adaptations to kmir.md so that we can look up functions by their type Ty
    • functions table is now keyed on Ty instead of DefId
    • caller and currentFunc fields likewise contain a Ty
    • the main function is added to the functions table with ty(-1) key to work around a shortfall of stable-mir-json: Add main to functions array stable-mir-json#42
    • various other adaptations and stub code to write function call arguments to resp. local values
  • A basic program where main() calls a(), which calls b(), which calls c() is added as a first integration test
  • The #init function is adapted to support executing functions other than main (not tested yet)

@jberthold jberthold force-pushed the jb/exec-arbitrary-entry-function branch from 375a4dc to 1f880d3 Compare February 4, 2025 04:38
@jberthold jberthold force-pushed the jb/exec-arbitrary-entry-function branch from f193657 to 3b193ef Compare February 4, 2025 05:14
@jberthold jberthold marked this pull request as ready for review February 4, 2025 05:16
Copy link
Contributor

@gtrepta gtrepta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. I opened #446 to merge into this branch. Feel free to merge in my changes. Otherwise, I'll go over your review when I get back to work tomorrow.

@jberthold jberthold merged commit b5adfdc into master Feb 4, 2025
5 checks passed
@jberthold jberthold deleted the jb/exec-arbitrary-entry-function branch February 4, 2025 23:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants