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

Refactor ctx.add_instruction() and friends #3685

Merged
merged 23 commits into from
Dec 12, 2023

Conversation

harkal
Copy link
Collaborator

@harkal harkal commented Dec 8, 2023

What I did

Refactored the family of add instruction methods in IRFunction and IRBasicBlock with the aim to only using basic block methods to add instructions

How I did it

With lots of coffee

How to verify it

Commit message

Commit message for the final, squashed PR. (Optional, but reviewers will appreciate it! Please see our commit message style guide for what we would ideally like to see in a commit message.)

Description for the changelog

Cute Animal Picture

Put a link to a cute animal picture inside the parenthesis-->

@harkal harkal self-assigned this Dec 8, 2023
@harkal harkal added the Refactor Issues related to refactoring the codebase label Dec 8, 2023
@harkal harkal marked this pull request as draft December 8, 2023 14:04
@codecov-commenter
Copy link

codecov-commenter commented Dec 8, 2023

Codecov Report

Attention: 136 lines in your changes are missing coverage. Please review.

Comparison is base (7c74aa2) 83.82% compared to head (7932914) 83.95%.

Files Patch % Lines
vyper/venom/ir_node_to_venom.py 1.61% 122 Missing ⚠️
vyper/venom/basicblock.py 69.23% 8 Missing ⚠️
vyper/venom/venom_to_assembly.py 0.00% 5 Missing and 1 partial ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3685      +/-   ##
==========================================
+ Coverage   83.82%   83.95%   +0.12%     
==========================================
  Files          91       91              
  Lines       12778    12769       -9     
  Branches     2861     2867       +6     
==========================================
+ Hits        10711    10720       +9     
+ Misses       1643     1624      -19     
- Partials      424      425       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Refactored append instructions into a single append_instruction() method
with named arguments for returning or not a variable
@harkal harkal changed the title Refactor ctx.add_0instruction() and friends Refactor ctx.add_instruction() and friends Dec 8, 2023
@harkal harkal marked this pull request as ready for review December 8, 2023 15:21
@charles-cooper
Copy link
Member

@harkal some failing tests!

harkal and others added 10 commits December 9, 2023 18:13
Until now log instructions where pass through. Now we have a log instruction
in venom that takes the first argument to be the topic count
(in shape of doing table jmp etc in the future -essentialy have
instructions that require manipulation of operants before emit)
Remove output argument append_instruction() in IRBasicBlock
now the method decides by itself if there is an output value
Copy link
Member

@charles-cooper charles-cooper left a comment

Choose a reason for hiding this comment

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

nice, much cleaner. thanks!

@charles-cooper charles-cooper merged commit 10564dc into master Dec 12, 2023
158 checks passed
@charles-cooper charles-cooper deleted the refactor/ctx_add_instruction_and_friends branch December 12, 2023 17:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Refactor Issues related to refactoring the codebase
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants