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

Strip newline on show(::Operation) #22

Merged
merged 2 commits into from
Jan 2, 2024
Merged

Strip newline on show(::Operation) #22

merged 2 commits into from
Jan 2, 2024

Conversation

mofeing
Copy link
Member

@mofeing mofeing commented Dec 30, 2023

Base.show on Operation prints too many newlines. This PR fixes that by printing to a IOBuffer first and stripping the newlines before printing to the original IO.

It also adds the call to mlirOpPrintingFlagsDestroy destructor.

Before

julia> MLIR.IR.create_operation("asdfs.asdfsa", MLIR.IR.Location(); results=[MLIR.IR.MLIRType(Bool)])
%0 = "asdfs.asdfsa"() : () -> i1



julia>

After

julia> MLIR.IR.create_operation("asdfs.asdfsa", MLIR.IR.Location(); results=[MLIR.IR.MLIRType(Bool)])
%0 = "asdfs.asdfsa"() : () -> i1

julia>

@codecov-commenter
Copy link

codecov-commenter commented Dec 31, 2023

Codecov Report

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

Comparison is base (d239921) 41.04% compared to head (5785ce8) 40.84%.

Files Patch % Lines
src/IR/IR.jl 0.00% 4 Missing ⚠️

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

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #22      +/-   ##
==========================================
- Coverage   41.04%   40.84%   -0.20%     
==========================================
  Files           6        6              
  Lines         614      612       -2     
==========================================
- Hits          252      250       -2     
  Misses        362      362              

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

Copy link
Member

@Pangoraw Pangoraw left a comment

Choose a reason for hiding this comment

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

Thanks!

src/IR/IR.jl Outdated Show resolved Hide resolved
@Pangoraw Pangoraw merged commit bf96e49 into JuliaLLVM:main Jan 2, 2024
2 of 3 checks passed
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