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

Remove LLVMMD{String,Node}InContext #130503

Closed
wants to merge 2 commits into from

Conversation

nnethercote
Copy link
Contributor

They are both marked with FIXME comments saying they should be removed, because the corresponding LLVM functions are deprecated.

r? @nikic
cc @klensy

Because it's deprecated in LLVM. Use `LLVMMDStringInContext2` instead.
Because it's deprecated in LLVM. Use `LLVMMDNodeInContext2` instead.
@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Sep 18, 2024
@klensy
Copy link
Contributor

klensy commented Sep 18, 2024

this: #130389

@nnethercote
Copy link
Contributor Author

Some notes:

  • I don't know much about the LLVM API, I just saw the FIXME comments and decided to try to remove them. I have assumed that it's ok to freely convert Value to Metadata with LLVMValueAsMetadata and vice versa with LLVMMetadataAsValue.
  • Overall this makes the code a little uglier, with more of those conversion calls. A reasonable price to pay to avoid the deprecated functions?
  • LLVMMDNodeInContext is always called in conjunction with LLVMSetMetadata and LLVMMetadataAsValue. I don't know if there's a nice way to factor that out.

@nnethercote
Copy link
Contributor Author

this: #130389

Oh dear... interesting that it adds a Metadata type, I considered that but avoided it. Otherwise it looks very similar to mine, so I'll just close this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants