-
Notifications
You must be signed in to change notification settings - Fork 13.8k
Replace LLVMRustContextCreate
with normal LLVM-C API calls
#147549
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
base: master
Are you sure you want to change the base?
Conversation
Some changes occurred in compiler/rustc_codegen_gcc |
r? @nnethercote rustbot has assigned @nnethercote. Use |
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.
I'm no expert on this, but is this actually an improvement? LLVMRustContextCreate
isn't mentioned in #46437. And #46437 is now almost eight years old, and very little progress has apparently been made on it, which maybe suggests that it's not so important?
if a PR was filed that converted a whole bunch of the functions mentioned in #46437, that might be more compelling. But changing a single function like this... is it really worthwhile?
|
||
unsafe extern "C" { | ||
// Create and destroy contexts. | ||
pub(crate) fn LLVMContextCreate() -> &'static mut Context; |
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.
Remark: Seeing &'static mut
is always terrifying, but since the existing LLVMRust binding already does the same thing, I guess this isn't making things any worse.
I've been planning some changes of my own to replace these with raw pointers, but I can just as easily do that after merging this PR, so this is fine.
IMO there is a modest benefit in making this change, since removing LLVMRust bindings makes it easier to audit the ones that remain. And in fact I was already planning a similar change of my own, so I'm willing to vouch for this being worthwhile. |
r? Zalathar |
Since `LLVMRustContextCreate` can easily be replaced with a call to `LLVMContextCreate` and `LLVMContextSetDiscardValueNames`.
5f8c98b
to
0abecda
Compare
Thanks. @bors r+ |
🌲 The tree is currently closed for pull requests below priority 100. This pull request will be tested once the tree is reopened. |
…ate, r=Zalathar Replace `LLVMRustContextCreate` with normal LLVM-C API calls Since `LLVMRustContextCreate` can easily be replaced with a call to `LLVMContextCreate` and `LLVMContextSetDiscardValueNames`. Work towards rust-lang#46437
Rollup of 12 pull requests Successful merges: - #138799 (core: simplify `Extend` for tuples) - #146692 (Save x.py's help text for saving output time) - #147168 (Don't unconditionally build alloc for `no-std` targets) - #147178 ([DebugInfo] Improve formatting of MSVC enum struct variants) - #147240 (Add an ACP list item to the library tracking issue template) - #147246 (Explain not existed key in BTreeMap::split_off) - #147393 (Extract most code from `define_feedable!`) - #147495 (Update wasm-component-ld to 0.5.18) - #147503 (Fix documentation of Instant::now on mac) - #147541 (Change int-to-ptr transmute lowering back to inttoptr) - #147549 (Replace `LLVMRustContextCreate` with normal LLVM-C API calls) - #147596 (Adjust the Arm targets in CI to reflect latest changes) r? `@ghost` `@rustbot` modify labels: rollup
…ate, r=Zalathar Replace `LLVMRustContextCreate` with normal LLVM-C API calls Since `LLVMRustContextCreate` can easily be replaced with a call to `LLVMContextCreate` and `LLVMContextSetDiscardValueNames`. Work towards rust-lang#46437
Rollup of 8 pull requests Successful merges: - #138799 (core: simplify `Extend` for tuples) - #145897 (Rehome 30 `tests/ui/issues/` tests to other subdirectories under `tests/ui/` [#4 of Batch #2]) - #146692 (Save x.py's help text for saving output time) - #147240 (Add an ACP list item to the library tracking issue template) - #147246 (Explain not existed key in BTreeMap::split_off) - #147393 (Extract most code from `define_feedable!`) - #147503 (Fix documentation of Instant::now on mac) - #147549 (Replace `LLVMRustContextCreate` with normal LLVM-C API calls) r? `@ghost` `@rustbot` modify labels: rollup
Since
LLVMRustContextCreate
can easily be replaced with a call toLLVMContextCreate
andLLVMContextSetDiscardValueNames
.Work towards #46437