Skip to content

Commit

Permalink
Rollup merge of rust-lang#118142 - saethlin:llvm-linkage, r=tmiasko
Browse files Browse the repository at this point in the history
Tighten up link attributes for llvm-wrapper bindings

Fixes rust-lang#118084 by moving all of the declarations of symbols from `llvm_rust` into a separate extern block with `#[link(name = "llvm-wrapper", kind = "static")]`.

This also renames `LLVMTimeTraceProfiler*` to `LLVMRustTimeTraceProfiler*` because those are functions from `llvm_rust`.

r? tmiasko
  • Loading branch information
compiler-errors authored Nov 22, 2023
2 parents 90f04e1 + e6f8edf commit dd9f3ad
Show file tree
Hide file tree
Showing 4 changed files with 206 additions and 180 deletions.
4 changes: 2 additions & 2 deletions compiler/rustc_codegen_llvm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ struct TimeTraceProfiler {
impl TimeTraceProfiler {
fn new(enabled: bool) -> Self {
if enabled {
unsafe { llvm::LLVMTimeTraceProfilerInitialize() }
unsafe { llvm::LLVMRustTimeTraceProfilerInitialize() }
}
TimeTraceProfiler { enabled }
}
Expand All @@ -113,7 +113,7 @@ impl TimeTraceProfiler {
impl Drop for TimeTraceProfiler {
fn drop(&mut self) {
if self.enabled {
unsafe { llvm::LLVMTimeTraceProfilerFinishThread() }
unsafe { llvm::LLVMRustTimeTraceProfilerFinishThread() }
}
}
}
Expand Down
Loading

0 comments on commit dd9f3ad

Please sign in to comment.