diff options
| author | Denis Merigoux <denis.merigoux@gmail.com> | 2018-09-26 16:01:43 +0200 |
|---|---|---|
| committer | Eduard-Mihai Burtescu <edy.burt@gmail.com> | 2018-11-16 14:36:43 +0200 |
| commit | 91a2a8069213aefb3e7aba8e5edd9e4df23364c4 (patch) | |
| tree | 89f102c985f7d300e70b91c31370f1ac29ba27eb /src/librustc_codegen_llvm | |
| parent | 8d530db2c5e63da2fed3ec1ac3bba2fa0fb4363c (diff) | |
| download | rust-91a2a8069213aefb3e7aba8e5edd9e4df23364c4.tar.gz rust-91a2a8069213aefb3e7aba8e5edd9e4df23364c4.zip | |
Renamed lifetimes for better understanding
Diffstat (limited to 'src/librustc_codegen_llvm')
| -rw-r--r-- | src/librustc_codegen_llvm/context.rs | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/src/librustc_codegen_llvm/context.rs b/src/librustc_codegen_llvm/context.rs index 41e5bed123e..af75c15e260 100644 --- a/src/librustc_codegen_llvm/context.rs +++ b/src/librustc_codegen_llvm/context.rs @@ -45,14 +45,14 @@ use abi::Abi; /// There is one `CodegenCx` per compilation unit. Each one has its own LLVM /// `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<'a, 'tcx: 'a, V = &'a Value> { - pub tcx: TyCtxt<'a, 'tcx, 'tcx>, +pub struct CodegenCx<'ll, 'tcx: 'll, V = &'ll Value> { + pub tcx: TyCtxt<'ll, 'tcx, 'tcx>, pub check_overflow: bool, pub use_dll_storage_attrs: bool, pub tls_model: llvm::ThreadLocalMode, - pub llmod: &'a llvm::Module, - pub llcx: &'a llvm::Context, + pub llmod: &'ll llvm::Module, + pub llcx: &'ll llvm::Context, pub stats: RefCell<Stats>, pub codegen_unit: Arc<CodegenUnit<'tcx>>, @@ -86,12 +86,12 @@ pub struct CodegenCx<'a, 'tcx: 'a, V = &'a Value> { /// See http://llvm.org/docs/LangRef.html#the-llvm-used-global-variable for details pub used_statics: RefCell<Vec<V>>, - pub lltypes: RefCell<FxHashMap<(Ty<'tcx>, Option<VariantIdx>), &'a Type>>, - pub scalar_lltypes: RefCell<FxHashMap<Ty<'tcx>, &'a Type>>, + pub lltypes: RefCell<FxHashMap<(Ty<'tcx>, Option<VariantIdx>), &'ll Type>>, + pub scalar_lltypes: RefCell<FxHashMap<Ty<'tcx>, &'ll Type>>, pub pointee_infos: RefCell<FxHashMap<(Ty<'tcx>, Size), Option<PointeeInfo>>>, - pub isize_ty: &'a Type, + pub isize_ty: &'ll Type, - pub dbg_cx: Option<debuginfo::CrateDebugContext<'a, 'tcx>>, + pub dbg_cx: Option<debuginfo::CrateDebugContext<'ll, 'tcx>>, eh_personality: Cell<Option<V>>, eh_unwind_resume: Cell<Option<V>>, @@ -103,8 +103,7 @@ pub struct CodegenCx<'a, 'tcx: 'a, V = &'a Value> { local_gen_sym_counter: Cell<usize>, } -impl<'a, 'tcx> DepGraphSafe for CodegenCx<'a, 'tcx> { -} +impl<'ll, 'tcx> DepGraphSafe for CodegenCx<'ll, 'tcx> {} pub fn get_reloc_model(sess: &Session) -> llvm::RelocMode { let reloc_model_arg = match sess.opts.cg.relocation_model { @@ -217,11 +216,11 @@ pub unsafe fn create_module( llmod } -impl<'a, 'tcx> CodegenCx<'a, 'tcx> { - crate fn new(tcx: TyCtxt<'a, 'tcx, 'tcx>, +impl<'ll, 'tcx> CodegenCx<'ll, 'tcx> { + crate fn new(tcx: TyCtxt<'ll, 'tcx, 'tcx>, codegen_unit: Arc<CodegenUnit<'tcx>>, - llvm_module: &'a ::ModuleLlvm) - -> CodegenCx<'a, 'tcx> { + llvm_module: &'ll ::ModuleLlvm) + -> Self { // An interesting part of Windows which MSVC forces our hand on (and // apparently MinGW didn't) is the usage of `dllimport` and `dllexport` // attributes in LLVM IR as well as native dependencies (in C these |
