Skip to content

Commit eaa7a7c

Browse files
authored
Rollup merge of rust-lang#148870 - QnnOkabayashi:remove-unused-value, r=wesleywiser
Remove unused LLVMModuleRef argument
2 parents 4d32047 + c7e50d0 commit eaa7a7c

File tree

3 files changed

+3
-5
lines changed

3 files changed

+3
-5
lines changed

compiler/rustc_codegen_llvm/src/back/write.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -683,7 +683,7 @@ pub(crate) unsafe fn llvm_optimize(
683683
// Here we map the old arguments to the new arguments, with an offset of 1 to make sure
684684
// that we don't use the newly added `%dyn_ptr`.
685685
unsafe {
686-
llvm::LLVMRustOffloadMapper(cx.llmod(), old_fn, new_fn);
686+
llvm::LLVMRustOffloadMapper(old_fn, new_fn);
687687
}
688688

689689
llvm::set_linkage(new_fn, llvm::get_linkage(old_fn));

compiler/rustc_codegen_llvm/src/llvm/ffi.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2025,7 +2025,7 @@ unsafe extern "C" {
20252025
) -> &Attribute;
20262026

20272027
// Operations on functions
2028-
pub(crate) fn LLVMRustOffloadMapper<'a>(M: &'a Module, Fn: &'a Value, Fn: &'a Value);
2028+
pub(crate) fn LLVMRustOffloadMapper<'a>(Fn: &'a Value, Fn: &'a Value);
20292029
pub(crate) fn LLVMRustGetOrInsertFunction<'a>(
20302030
M: &'a Module,
20312031
Name: *const c_char,

compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -144,9 +144,7 @@ extern "C" void LLVMRustPrintStatistics(RustStringRef OutBuf) {
144144
llvm::PrintStatistics(OS);
145145
}
146146

147-
extern "C" void LLVMRustOffloadMapper(LLVMModuleRef M, LLVMValueRef OldFn,
148-
LLVMValueRef NewFn) {
149-
llvm::Module *module = llvm::unwrap(M);
147+
extern "C" void LLVMRustOffloadMapper(LLVMValueRef OldFn, LLVMValueRef NewFn) {
150148
llvm::Function *oldFn = llvm::unwrap<llvm::Function>(OldFn);
151149
llvm::Function *newFn = llvm::unwrap<llvm::Function>(NewFn);
152150

0 commit comments

Comments
 (0)