diff options
| author | bors <bors@rust-lang.org> | 2021-12-18 18:08:51 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2021-12-18 18:08:51 +0000 |
| commit | 91a0600a5c22b9d159e3c57526af83e71d1120f8 (patch) | |
| tree | 142be686bed6df375c8d289790e67dd1affd7fd9 /compiler/rustc_codegen_llvm/src/common.rs | |
| parent | d3848cb659105d8384c00ba384ec2f6f39c47238 (diff) | |
| parent | 1ac1f24ddd54865f1719eb8c0e48c4858be1b744 (diff) | |
| download | rust-91a0600a5c22b9d159e3c57526af83e71d1120f8.tar.gz rust-91a0600a5c22b9d159e3c57526af83e71d1120f8.zip | |
Auto merge of #92065 - matthiaskrgr:rollup-qmpcsuj, r=matthiaskrgr
Rollup of 7 pull requests Successful merges: - #91566 (Apply path remapping to DW_AT_GNU_dwo_name when producing split DWARF) - #91926 (Remove `in_band_lifetimes` from `rustc_metadata`) - #91931 (Remove `in_band_lifetimes` from `rustc_codegen_llvm`) - #92024 (rustc_codegen_llvm: Give each codegen unit a unique DWARF name on all platforms, not just Apple ones.) - #92037 (Use a const ParamEnv when in default_method_body_is_const) - #92047 (Set `RUST_BACKTRACE=0` when running location-detail tests) - #92050 (Add a space and 2 grave accents ) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_codegen_llvm/src/common.rs')
| -rw-r--r-- | compiler/rustc_codegen_llvm/src/common.rs | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/compiler/rustc_codegen_llvm/src/common.rs b/compiler/rustc_codegen_llvm/src/common.rs index d0ed9781243..9d34734f4e5 100644 --- a/compiler/rustc_codegen_llvm/src/common.rs +++ b/compiler/rustc_codegen_llvm/src/common.rs @@ -65,7 +65,7 @@ pub struct Funclet<'ll> { operand: OperandBundleDef<'ll>, } -impl Funclet<'ll> { +impl<'ll> Funclet<'ll> { pub fn new(cleanuppad: &'ll Value) -> Self { Funclet { cleanuppad, operand: OperandBundleDef::new("funclet", &[cleanuppad]) } } @@ -79,7 +79,7 @@ impl Funclet<'ll> { } } -impl BackendTypes for CodegenCx<'ll, 'tcx> { +impl<'ll> BackendTypes for CodegenCx<'ll, '_> { type Value = &'ll Value; // FIXME(eddyb) replace this with a `Function` "subclass" of `Value`. type Function = &'ll Value; @@ -93,7 +93,7 @@ impl BackendTypes for CodegenCx<'ll, 'tcx> { type DIVariable = &'ll llvm::debuginfo::DIVariable; } -impl CodegenCx<'ll, 'tcx> { +impl<'ll> CodegenCx<'ll, '_> { pub fn const_array(&self, ty: &'ll Type, elts: &[&'ll Value]) -> &'ll Value { unsafe { llvm::LLVMConstArray(ty, elts.as_ptr(), elts.len() as c_uint) } } @@ -145,7 +145,7 @@ impl CodegenCx<'ll, 'tcx> { } } -impl ConstMethods<'tcx> for CodegenCx<'ll, 'tcx> { +impl<'ll, 'tcx> ConstMethods<'tcx> for CodegenCx<'ll, 'tcx> { fn const_null(&self, t: &'ll Type) -> &'ll Value { unsafe { llvm::LLVMConstNull(t) } } @@ -327,14 +327,18 @@ pub fn val_ty(v: &Value) -> &Type { unsafe { llvm::LLVMTypeOf(v) } } -pub fn bytes_in_context(llcx: &'ll llvm::Context, bytes: &[u8]) -> &'ll Value { +pub fn bytes_in_context<'ll>(llcx: &'ll llvm::Context, bytes: &[u8]) -> &'ll Value { unsafe { let ptr = bytes.as_ptr() as *const c_char; llvm::LLVMConstStringInContext(llcx, ptr, bytes.len() as c_uint, True) } } -pub fn struct_in_context(llcx: &'a llvm::Context, elts: &[&'a Value], packed: bool) -> &'a Value { +pub fn struct_in_context<'ll>( + llcx: &'ll llvm::Context, + elts: &[&'ll Value], + packed: bool, +) -> &'ll Value { unsafe { llvm::LLVMConstStructInContext(llcx, elts.as_ptr(), elts.len() as c_uint, packed as Bool) } |
