Skip to content

Commit 24bf404

Browse files
authored
Rollup merge of #137549 - oli-obk:llvm-ffi, r=davidtwco
Clean up various LLVM FFI things in codegen_llvm cc ```@ZuseZ4``` I touched some autodiff parts The major change of this PR is [bfd88ce](rust-lang/rust@bfd88ce) which makes `CodegenCx` generic just like `GenericBuilder` The other commits mostly took advantage of the new feature of making extern functions safe, but also just used some wrappers that were already there and shrunk unsafe blocks. best reviewed commit-by-commit
2 parents ab17806 + 334eb82 commit 24bf404

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

src/abi.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ use crate::context::CodegenCx;
1616
use crate::intrinsic::ArgAbiExt;
1717
use crate::type_of::LayoutGccExt;
1818

19-
impl<'a, 'gcc, 'tcx> AbiBuilderMethods<'tcx> for Builder<'a, 'gcc, 'tcx> {
19+
impl AbiBuilderMethods for Builder<'_, '_, '_> {
2020
fn get_param(&mut self, index: usize) -> Self::Value {
2121
let func = self.current_func();
2222
let param = func.get_param(index as i32);

src/common.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ pub fn type_is_pointer(typ: Type<'_>) -> bool {
5959
typ.get_pointee().is_some()
6060
}
6161

62-
impl<'gcc, 'tcx> ConstCodegenMethods<'tcx> for CodegenCx<'gcc, 'tcx> {
62+
impl<'gcc, 'tcx> ConstCodegenMethods for CodegenCx<'gcc, 'tcx> {
6363
fn const_null(&self, typ: Type<'gcc>) -> RValue<'gcc> {
6464
if type_is_pointer(typ) { self.context.new_null(typ) } else { self.const_int(typ, 0) }
6565
}
@@ -257,7 +257,7 @@ impl<'gcc, 'tcx> ConstCodegenMethods<'tcx> for CodegenCx<'gcc, 'tcx> {
257257
}
258258
}
259259

260-
fn const_data_from_alloc(&self, alloc: ConstAllocation<'tcx>) -> Self::Value {
260+
fn const_data_from_alloc(&self, alloc: ConstAllocation<'_>) -> Self::Value {
261261
const_alloc_to_gcc(self, alloc)
262262
}
263263

src/consts.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -302,9 +302,9 @@ impl<'gcc, 'tcx> CodegenCx<'gcc, 'tcx> {
302302
}
303303
}
304304

305-
pub fn const_alloc_to_gcc<'gcc, 'tcx>(
306-
cx: &CodegenCx<'gcc, 'tcx>,
307-
alloc: ConstAllocation<'tcx>,
305+
pub fn const_alloc_to_gcc<'gcc>(
306+
cx: &CodegenCx<'gcc, '_>,
307+
alloc: ConstAllocation<'_>,
308308
) -> RValue<'gcc> {
309309
let alloc = alloc.inner();
310310
let mut llvals = Vec::with_capacity(alloc.provenance().ptrs().len() + 1);

src/type_.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ impl<'gcc, 'tcx> CodegenCx<'gcc, 'tcx> {
123123
}
124124
}
125125

126-
impl<'gcc, 'tcx> BaseTypeCodegenMethods<'tcx> for CodegenCx<'gcc, 'tcx> {
126+
impl<'gcc, 'tcx> BaseTypeCodegenMethods for CodegenCx<'gcc, 'tcx> {
127127
fn type_i8(&self) -> Type<'gcc> {
128128
self.i8_type
129129
}

0 commit comments

Comments
 (0)