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

feat!: Lower string, print, and panic #78

Merged
merged 1 commit into from
Aug 20, 2024
Merged

feat!: Lower string, print, and panic #78

merged 1 commit into from
Aug 20, 2024

Conversation

mark-koch
Copy link
Contributor

@mark-koch mark-koch commented Aug 20, 2024

Closes #79.

Adds lowering logic for:

  • String type and ConstString (c-style)
  • Error type and ConstError
  • Print op (lowers to libc printf by default)
  • Panic op (lowers to libc abort by default)

BREAKING CHANGE: CodegenExtension::emitter has a new lifetime bound on the self argument. PreludeCodegen trait now requires Clone.

@mark-koch mark-koch requested a review from a team as a code owner August 20, 2024 12:37
@mark-koch mark-koch requested a review from qartik August 20, 2024 12:37
@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 85.24590% with 18 lines in your changes missing coverage. Please review.

Project coverage is 82.97%. Comparing base (ef6e337) to head (9f8b0c7).

Files Patch % Lines
src/custom/prelude.rs 86.53% 4 Missing and 10 partials ⚠️
src/emit/libc.rs 77.77% 0 Missing and 4 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #78      +/-   ##
==========================================
+ Coverage   82.54%   82.97%   +0.42%     
==========================================
  Files          17       18       +1     
  Lines        2280     2390     +110     
  Branches     2280     2390     +110     
==========================================
+ Hits         1882     1983     +101     
+ Misses        258      253       -5     
- Partials      140      154      +14     
Flag Coverage Δ
rust 82.97% <85.24%> (+0.42%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

Copy link
Member

@qartik qartik left a comment

Choose a reason for hiding this comment

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

LGTM

@mark-koch mark-koch added this pull request to the merge queue Aug 20, 2024
Merged via the queue into main with commit 97ee196 Aug 20, 2024
11 of 12 checks passed
@mark-koch mark-koch deleted the feat/prelude branch August 20, 2024 16:09
@hugrbot hugrbot mentioned this pull request Aug 20, 2024
github-merge-queue bot pushed a commit that referenced this pull request Aug 27, 2024
## 🤖 New release
* `hugr-llvm`: 0.2.1 -> 0.3.0

<details><summary><i><b>Changelog</b></i></summary><p>

<blockquote>

## [0.3.0](v0.2.1...v0.3.0) -
2024-08-27

### New Features
- [**breaking**] Lower string, print, and panic
([#78](#78))
- Lower float operations
([#83](#83))
- Lower logic extension
([#81](#81))
- Lower arrays ([#82](#82))
</blockquote>


</p></details>

---
This PR was generated with
[release-plz](https://github.com/MarcoIeni/release-plz/).
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.

Implement emission for print and panic
3 participants