-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
llvm: replace some deprecated functions #130389
Conversation
r? @wesleywiser rustbot has assigned @wesleywiser. Use |
This comment has been minimized.
This comment has been minimized.
Some changes occurred in compiler/rustc_codegen_gcc |
☔ The latest upstream changes (presumably #130519) made this pull request unmergeable. Please resolve the merge conflicts. |
475d65c
to
b7c5656
Compare
); | ||
let md = llvm::LLVMMDNodeInContext2(self.cx.llcx, v.as_ptr(), v.len()); | ||
let md = llvm::LLVMMetadataAsValue(&self.llcx, md); | ||
llvm::LLVMSetMetadata(load, llvm::MD_range as c_uint, md); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add a set_metadata
method that does the LLVMMetadataAsValue + LLVMSetMetadata dance?
LLVM should really allow setting the metadata without first wrapping it in a value and then unwrapping again, but we can at least hide this...
@@ -586,6 +586,14 @@ impl<'ll, 'tcx> CodegenCx<'ll, 'tcx> { | |||
llvm::LLVMSetSection(g, c"llvm.metadata".as_ptr()); | |||
} | |||
} | |||
|
|||
/// A wrapper for [`llvm::LLVMSetMetadata`], but it takes `Metadata` as a parameter instead of `Value`. | |||
pub(crate) fn set_metadata<'a>(&self, val: &'a Value, kind_id: c_uint, md: &'a Metadata) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Accept MetadataType here and move the c_uint cast into the method?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done :)
@bors r+ rollup |
llvm: replace some deprecated functions `LLVMMDStringInContext` and `LLVMMDNodeInContext` are deprecated, replace them with `LLVMMDStringInContext2` and `LLVMMDNodeInContext2`. Also replace `Value` with `Metadata` in some function signatures for better consistency.
This comment has been minimized.
This comment has been minimized.
💔 Test failed - checks-actions |
I can't reproduce the error with |
llvm: replace some deprecated functions `LLVMMDStringInContext` and `LLVMMDNodeInContext` are deprecated, replace them with `LLVMMDStringInContext2` and `LLVMMDNodeInContext2`. Also replace `Value` with `Metadata` in some function signatures for better consistency. try-job: x86_64-gnu-llvm-19
Ah crap, I didn't realize that bors retry also retires try builds. I'll just let it run to avoid confusing bors further. |
This comment has been minimized.
This comment has been minimized.
💔 Test failed - checks-actions |
Huh, and now it failed again. So probably something is legitimately wrong with this patch that makes things break non-deterministically -- but I'm not able to spot it. |
Okay, this test has been failing on some other PRs as well, I filed #130656. |
Problematic test has been removed, try again... @bors r+ |
💡 This pull request was already approved, no need to approve it again.
|
seems that it needs to run |
llvm: replace some deprecated functions `LLVMMDStringInContext` and `LLVMMDNodeInContext` are deprecated, replace them with `LLVMMDStringInContext2` and `LLVMMDNodeInContext2`. Also replace `Value` with `Metadata` in some function signatures for better consistency.
This comment has been minimized.
This comment has been minimized.
@bors r=nikic |
☀️ Test successful - checks-actions |
Finished benchmarking commit (4cbfcf1): comparison URL. Overall result: no relevant changes - no action needed@rustbot label: -perf-regression Instruction countThis benchmark run did not return any relevant results for this metric. Max RSS (memory usage)Results (secondary -3.0%)This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesResults (primary 1.8%)This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 770.84s -> 769.56s (-0.17%) |
LLVMMDStringInContext
andLLVMMDNodeInContext
are deprecated, replace them withLLVMMDStringInContext2
andLLVMMDNodeInContext2
.Also replace
Value
withMetadata
in some function signatures for better consistency.