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

Fix some minor pretty-printing bugs #115

Closed
wants to merge 2 commits into from
Closed

Fix some minor pretty-printing bugs #115

wants to merge 2 commits into from

Conversation

RyanGlScott
Copy link
Collaborator

This:

The `name` of a `DILabel` is meant to be escaped in double quotes.

Fixes #114.
As the LLVM source code indicates in
https://github.com/llvm/llvm-project/blob/9841daf27076886c6ab8e155eb812bda76f77532/llvm/lib/AsmParser/LLParser.cpp#L5215,
the intent was always to have `dicuRangesBaseAddress` be an optional field.
This updates the `llvm-pretty` AST to reflect this. With this change, picking a
default value of `Nothing` will cause `dicuRangesBaseAddress` not to be
pretty-printed, which makes it easier to support pre-11 versions of LLVM (when
`rangesBaseAddress` was introduced).

Fixes #113.
kquick added a commit to GaloisInc/llvm-pretty-bc-parser that referenced this pull request Jul 10, 2023
@elliottt
Copy link
Collaborator

The changes seem good to me, but I'm happy to re-review when this is marked ready :)

@RyanGlScott
Copy link
Collaborator Author

For context: these are both issues that we ran into while trying to make the test case from GaloisInc/llvm-pretty-bc-parser#223 work on older LLVMs. I was hoping that these two commits would be enough to make that test case go through, but sadly, we uncovered yet another issue in #116, and fixing #116 is unlikely to be as straightforward.

Considering that this PR does introduce a breaking API change, I'm inclined to park this until we know for sure that this approach will in fact fix GaloisInc/llvm-pretty-bc-parser#223, #116, and any related issues we encounter in the process.

@RyanGlScott
Copy link
Collaborator Author

This PR fixes the issue by wrapping a field in a Maybe, which is a rather heavy-handed fix. A better solution would be to change the behavior of the pretty-printer depending on whether LLVM 11+ is being used or not. And in fact, @kquick's recent series of PRs have now introduced machinery to make this possible, and @kquick proposes fixing the issue by using this machinery. I'm inclined to agree, so I'll close this PR in favor of this alternative solution.

@RyanGlScott RyanGlScott closed this Aug 7, 2023
@RyanGlScott
Copy link
Collaborator Author

Superseded by #121.

@RyanGlScott RyanGlScott deleted the T114 branch August 7, 2023 21:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants