Skip to content

Commit

Permalink
Unrolled build for rust-lang#118142
Browse files Browse the repository at this point in the history
Rollup merge of rust-lang#118142 - saethlin:llvm-linkage, r=tmiasko

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
rust-timer committed Nov 22, 2023
2 parents 6d2b84b + e6f8edf commit 3bc61c7
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

0 comments on commit 3bc61c7

Please sign in to comment.