X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=compiler%2Frustc_codegen_llvm%2Fsrc%2Fcontext.rs;h=fe55bf8686e25dff6fd3e83f1904df9dce7039be;hb=53a95ea289941ffeacb95f2ca7a7a7f1a9aae679;hp=613a8df891ce4e5914e5ba617402db72b58362e9;hpb=f62984fca98a60cbb545a7c2bce3fc878ce1f1d3;p=rust.git diff --git a/compiler/rustc_codegen_llvm/src/context.rs b/compiler/rustc_codegen_llvm/src/context.rs index 613a8df891c..fe55bf8686e 100644 --- a/compiler/rustc_codegen_llvm/src/context.rs +++ b/compiler/rustc_codegen_llvm/src/context.rs @@ -124,7 +124,7 @@ fn to_llvm_tls_model(tls_model: TlsModel) -> llvm::ThreadLocalMode { } } -pub unsafe fn create_module( +pub unsafe fn create_module<'ll>( tcx: TyCtxt<'_>, llcx: &'ll llvm::Context, mod_name: &str, @@ -363,7 +363,7 @@ impl<'ll, 'tcx> CodegenCx<'ll, 'tcx> { } #[inline] - pub fn coverage_context(&'a self) -> Option<&'a coverageinfo::CrateCoverageContext<'ll, 'tcx>> { + pub fn coverage_context(&self) -> Option<&coverageinfo::CrateCoverageContext<'ll, 'tcx>> { self.coverage_cx.as_ref() } @@ -380,7 +380,7 @@ fn create_used_variable_impl(&self, name: &'static CStr, values: &[&'ll Value]) } } -impl MiscMethods<'tcx> for CodegenCx<'ll, 'tcx> { +impl<'ll, 'tcx> MiscMethods<'tcx> for CodegenCx<'ll, 'tcx> { fn vtables( &self, ) -> &RefCell, Option>), &'ll Value>> @@ -504,8 +504,8 @@ fn declare_c_main(&self, fn_type: Self::Type) -> Option { } } -impl CodegenCx<'b, 'tcx> { - crate fn get_intrinsic(&self, key: &str) -> (&'b Type, &'b Value) { +impl<'ll> CodegenCx<'ll, '_> { + crate fn get_intrinsic(&self, key: &str) -> (&'ll Type, &'ll Value) { if let Some(v) = self.intrinsics.borrow().get(key).cloned() { return v; } @@ -516,9 +516,9 @@ impl CodegenCx<'b, 'tcx> { fn insert_intrinsic( &self, name: &'static str, - args: Option<&[&'b llvm::Type]>, - ret: &'b llvm::Type, - ) -> (&'b llvm::Type, &'b llvm::Value) { + args: Option<&[&'ll llvm::Type]>, + ret: &'ll llvm::Type, + ) -> (&'ll llvm::Type, &'ll llvm::Value) { let fn_ty = if let Some(args) = args { self.type_func(args, ret) } else { @@ -529,7 +529,7 @@ fn insert_intrinsic( (fn_ty, f) } - fn declare_intrinsic(&self, key: &str) -> Option<(&'b Type, &'b Value)> { + fn declare_intrinsic(&self, key: &str) -> Option<(&'ll Type, &'ll Value)> { macro_rules! ifn { ($name:expr, fn() -> $ret:expr) => ( if key == $name { @@ -793,7 +793,7 @@ macro_rules! mk_struct { None } - crate fn eh_catch_typeinfo(&self) -> &'b Value { + crate fn eh_catch_typeinfo(&self) -> &'ll Value { if let Some(eh_catch_typeinfo) = self.eh_catch_typeinfo.get() { return eh_catch_typeinfo; } @@ -813,7 +813,7 @@ macro_rules! mk_struct { } } -impl<'b, 'tcx> CodegenCx<'b, 'tcx> { +impl CodegenCx<'_, '_> { /// Generates a new symbol name with the given prefix. This symbol name must /// only be used for definitions with `internal` or `private` linkage. pub fn generate_local_symbol_name(&self, prefix: &str) -> String { @@ -829,21 +829,21 @@ pub fn generate_local_symbol_name(&self, prefix: &str) -> String { } } -impl HasDataLayout for CodegenCx<'ll, 'tcx> { +impl HasDataLayout for CodegenCx<'_, '_> { #[inline] fn data_layout(&self) -> &TargetDataLayout { &self.tcx.data_layout } } -impl HasTargetSpec for CodegenCx<'ll, 'tcx> { +impl HasTargetSpec for CodegenCx<'_, '_> { #[inline] fn target_spec(&self) -> &Target { &self.tcx.sess.target } } -impl ty::layout::HasTyCtxt<'tcx> for CodegenCx<'ll, 'tcx> { +impl<'tcx> ty::layout::HasTyCtxt<'tcx> for CodegenCx<'_, 'tcx> { #[inline] fn tcx(&self) -> TyCtxt<'tcx> { self.tcx @@ -856,7 +856,7 @@ fn param_env(&self) -> ty::ParamEnv<'tcx> { } } -impl LayoutOfHelpers<'tcx> for CodegenCx<'ll, 'tcx> { +impl<'tcx> LayoutOfHelpers<'tcx> for CodegenCx<'_, 'tcx> { type LayoutOfResult = TyAndLayout<'tcx>; #[inline] @@ -869,7 +869,7 @@ fn handle_layout_err(&self, err: LayoutError<'tcx>, span: Span, ty: Ty<'tcx>) -> } } -impl FnAbiOfHelpers<'tcx> for CodegenCx<'ll, 'tcx> { +impl<'tcx> FnAbiOfHelpers<'tcx> for CodegenCx<'_, 'tcx> { type FnAbiOfResult = &'tcx FnAbi<'tcx, Ty<'tcx>>; #[inline]