diff options
| author | Eduard-Mihai Burtescu <edy.burt@gmail.com> | 2019-06-14 00:48:52 +0300 |
|---|---|---|
| committer | Eduard-Mihai Burtescu <edy.burt@gmail.com> | 2019-06-14 18:58:23 +0300 |
| commit | f3f9d6dfd92dfaeb14df891ad27b2531809dd734 (patch) | |
| tree | cc6b503f85dcfa52dde1c95b52a35c3b94569a84 /src/librustc_codegen_llvm | |
| parent | 0e4a56b4b04ea98bb16caada30cb2418dd06e250 (diff) | |
| download | rust-f3f9d6dfd92dfaeb14df891ad27b2531809dd734.tar.gz rust-f3f9d6dfd92dfaeb14df891ad27b2531809dd734.zip | |
Unify all uses of 'gcx and 'tcx.
Diffstat (limited to 'src/librustc_codegen_llvm')
| -rw-r--r-- | src/librustc_codegen_llvm/allocator.rs | 2 | ||||
| -rw-r--r-- | src/librustc_codegen_llvm/attributes.rs | 2 | ||||
| -rw-r--r-- | src/librustc_codegen_llvm/back/write.rs | 2 | ||||
| -rw-r--r-- | src/librustc_codegen_llvm/base.rs | 8 | ||||
| -rw-r--r-- | src/librustc_codegen_llvm/builder.rs | 2 | ||||
| -rw-r--r-- | src/librustc_codegen_llvm/context.rs | 8 | ||||
| -rw-r--r-- | src/librustc_codegen_llvm/debuginfo/metadata.rs | 2 | ||||
| -rw-r--r-- | src/librustc_codegen_llvm/lib.rs | 18 |
8 files changed, 22 insertions, 22 deletions
diff --git a/src/librustc_codegen_llvm/allocator.rs b/src/librustc_codegen_llvm/allocator.rs index 27ec939dd29..02a05fd1102 100644 --- a/src/librustc_codegen_llvm/allocator.rs +++ b/src/librustc_codegen_llvm/allocator.rs @@ -9,7 +9,7 @@ use rustc_allocator::{ALLOCATOR_METHODS, AllocatorTy}; use crate::ModuleLlvm; use crate::llvm::{self, False, True}; -pub(crate) unsafe fn codegen(tcx: TyCtxt<'_, '_>, mods: &mut ModuleLlvm, kind: AllocatorKind) { +pub(crate) unsafe fn codegen(tcx: TyCtxt<'_>, mods: &mut ModuleLlvm, kind: AllocatorKind) { let llcx = &*mods.llcx; let llmod = mods.llmod(); let usize = match &tcx.sess.target.target.target_pointer_width[..] { diff --git a/src/librustc_codegen_llvm/attributes.rs b/src/librustc_codegen_llvm/attributes.rs index f68f3de1185..4735588f29a 100644 --- a/src/librustc_codegen_llvm/attributes.rs +++ b/src/librustc_codegen_llvm/attributes.rs @@ -367,7 +367,7 @@ pub fn provide_extern(providers: &mut Providers<'_>) { }; } -fn wasm_import_module(tcx: TyCtxt<'_, '_>, id: DefId) -> Option<CString> { +fn wasm_import_module(tcx: TyCtxt<'_>, id: DefId) -> Option<CString> { tcx.wasm_import_module_map(id.krate) .get(&id) .map(|s| CString::new(&s[..]).unwrap()) diff --git a/src/librustc_codegen_llvm/back/write.rs b/src/librustc_codegen_llvm/back/write.rs index 6f3f9d4cb8b..3638730707f 100644 --- a/src/librustc_codegen_llvm/back/write.rs +++ b/src/librustc_codegen_llvm/back/write.rs @@ -89,7 +89,7 @@ pub fn create_informational_target_machine( } pub fn create_target_machine( - tcx: TyCtxt<'_, '_>, + tcx: TyCtxt<'_>, find_features: bool, ) -> &'static mut llvm::TargetMachine { target_machine_factory(&tcx.sess, tcx.backend_optimization_level(LOCAL_CRATE), find_features)() diff --git a/src/librustc_codegen_llvm/base.rs b/src/librustc_codegen_llvm/base.rs index 9d2cd861887..04645dacfec 100644 --- a/src/librustc_codegen_llvm/base.rs +++ b/src/librustc_codegen_llvm/base.rs @@ -41,8 +41,8 @@ use rustc::hir::CodegenFnAttrs; use crate::value::Value; -pub fn write_compressed_metadata<'gcx>( - tcx: TyCtxt<'gcx, 'gcx>, +pub fn write_compressed_metadata<'tcx>( + tcx: TyCtxt<'tcx>, metadata: &EncodedMetadata, llvm_module: &mut ModuleLlvm, ) { @@ -103,7 +103,7 @@ pub fn iter_globals(llmod: &'ll llvm::Module) -> ValueIter<'ll> { } } -pub fn compile_codegen_unit(tcx: TyCtxt<'tcx, 'tcx>, cgu_name: InternedString) { +pub fn compile_codegen_unit(tcx: TyCtxt<'tcx>, cgu_name: InternedString) { let start_time = Instant::now(); let dep_node = tcx.codegen_unit(cgu_name).codegen_dep_node(tcx); @@ -124,7 +124,7 @@ pub fn compile_codegen_unit(tcx: TyCtxt<'tcx, 'tcx>, cgu_name: InternedString) { submit_codegened_module_to_llvm(&LlvmCodegenBackend(()), tcx, module, cost); fn module_codegen<'tcx>( - tcx: TyCtxt<'tcx, 'tcx>, + tcx: TyCtxt<'tcx>, cgu_name: InternedString, ) -> ModuleCodegen<ModuleLlvm> { let cgu = tcx.codegen_unit(cgu_name); diff --git a/src/librustc_codegen_llvm/builder.rs b/src/librustc_codegen_llvm/builder.rs index 2febba6766d..9102ba91df8 100644 --- a/src/librustc_codegen_llvm/builder.rs +++ b/src/librustc_codegen_llvm/builder.rs @@ -66,7 +66,7 @@ impl ty::layout::HasDataLayout for Builder<'_, '_, '_> { } impl ty::layout::HasTyCtxt<'tcx> for Builder<'_, '_, 'tcx> { - fn tcx(&self) -> TyCtxt<'tcx, 'tcx> { + fn tcx(&self) -> TyCtxt<'tcx> { self.cx.tcx } } diff --git a/src/librustc_codegen_llvm/context.rs b/src/librustc_codegen_llvm/context.rs index 0a780fecf41..967fe877fd1 100644 --- a/src/librustc_codegen_llvm/context.rs +++ b/src/librustc_codegen_llvm/context.rs @@ -35,7 +35,7 @@ use crate::abi::Abi; /// `llvm::Context` so that several compilation units may be optimized in parallel. /// All other LLVM data structures in the `CodegenCx` are tied to that `llvm::Context`. pub struct CodegenCx<'ll, 'tcx: 'll> { - pub tcx: TyCtxt<'tcx, 'tcx>, + pub tcx: TyCtxt<'tcx>, pub check_overflow: bool, pub use_dll_storage_attrs: bool, pub tls_model: llvm::ThreadLocalMode, @@ -141,7 +141,7 @@ pub fn is_pie_binary(sess: &Session) -> bool { } pub unsafe fn create_module( - tcx: TyCtxt<'_, '_>, + tcx: TyCtxt<'_>, llcx: &'ll llvm::Context, mod_name: &str, ) -> &'ll llvm::Module { @@ -208,7 +208,7 @@ pub unsafe fn create_module( impl<'ll, 'tcx> CodegenCx<'ll, 'tcx> { crate fn new( - tcx: TyCtxt<'tcx, 'tcx>, + tcx: TyCtxt<'tcx>, codegen_unit: Arc<CodegenUnit<'tcx>>, llvm_module: &'ll crate::ModuleLlvm, ) -> Self { @@ -839,7 +839,7 @@ impl HasTargetSpec for CodegenCx<'ll, 'tcx> { } impl ty::layout::HasTyCtxt<'tcx> for CodegenCx<'ll, 'tcx> { - fn tcx(&self) -> TyCtxt<'tcx, 'tcx> { + fn tcx(&self) -> TyCtxt<'tcx> { self.tcx } } diff --git a/src/librustc_codegen_llvm/debuginfo/metadata.rs b/src/librustc_codegen_llvm/debuginfo/metadata.rs index 3c37240b166..d43adc9cb92 100644 --- a/src/librustc_codegen_llvm/debuginfo/metadata.rs +++ b/src/librustc_codegen_llvm/debuginfo/metadata.rs @@ -894,7 +894,7 @@ fn pointer_type_metadata( } pub fn compile_unit_metadata( - tcx: TyCtxt<'_, '_>, + tcx: TyCtxt<'_>, codegen_unit_name: &str, debug_context: &CrateDebugContext<'ll, '_>, ) -> &'ll DIDescriptor { diff --git a/src/librustc_codegen_llvm/lib.rs b/src/librustc_codegen_llvm/lib.rs index 9a0860bc4b0..e03de7799d3 100644 --- a/src/librustc_codegen_llvm/lib.rs +++ b/src/librustc_codegen_llvm/lib.rs @@ -105,21 +105,21 @@ mod va_arg; pub struct LlvmCodegenBackend(()); impl ExtraBackendMethods for LlvmCodegenBackend { - fn new_metadata(&self, tcx: TyCtxt<'_, '_>, mod_name: &str) -> ModuleLlvm { + fn new_metadata(&self, tcx: TyCtxt<'_>, mod_name: &str) -> ModuleLlvm { ModuleLlvm::new_metadata(tcx, mod_name) } - fn write_compressed_metadata<'gcx>( + fn write_compressed_metadata<'tcx>( &self, - tcx: TyCtxt<'gcx, 'gcx>, + tcx: TyCtxt<'tcx>, metadata: &EncodedMetadata, llvm_module: &mut ModuleLlvm, ) { base::write_compressed_metadata(tcx, metadata, llvm_module) } - fn codegen_allocator<'gcx>( + fn codegen_allocator<'tcx>( &self, - tcx: TyCtxt<'gcx, 'gcx>, + tcx: TyCtxt<'tcx>, mods: &mut ModuleLlvm, kind: AllocatorKind, ) { @@ -127,7 +127,7 @@ impl ExtraBackendMethods for LlvmCodegenBackend { } fn compile_codegen_unit<'a, 'tcx: 'a>( &self, - tcx: TyCtxt<'tcx, 'tcx>, + tcx: TyCtxt<'tcx>, cgu_name: InternedString, ) { base::compile_codegen_unit(tcx, cgu_name); @@ -288,7 +288,7 @@ impl CodegenBackend for LlvmCodegenBackend { fn codegen_crate<'tcx>( &self, - tcx: TyCtxt<'tcx, 'tcx>, + tcx: TyCtxt<'tcx>, metadata: EncodedMetadata, need_metadata_module: bool, rx: mpsc::Receiver<Box<dyn Any + Send>>, @@ -367,7 +367,7 @@ unsafe impl Send for ModuleLlvm { } unsafe impl Sync for ModuleLlvm { } impl ModuleLlvm { - fn new(tcx: TyCtxt<'_, '_>, mod_name: &str) -> Self { + fn new(tcx: TyCtxt<'_>, mod_name: &str) -> Self { unsafe { let llcx = llvm::LLVMRustContextCreate(tcx.sess.fewer_names()); let llmod_raw = context::create_module(tcx, llcx, mod_name) as *const _; @@ -379,7 +379,7 @@ impl ModuleLlvm { } } - fn new_metadata(tcx: TyCtxt<'_, '_>, mod_name: &str) -> Self { + fn new_metadata(tcx: TyCtxt<'_>, mod_name: &str) -> Self { unsafe { let llcx = llvm::LLVMRustContextCreate(tcx.sess.fewer_names()); let llmod_raw = context::create_module(tcx, llcx, mod_name) as *const _; |
