Skip to content

Commit 91a2a80

Browse files
denismerigouxeddyb
authored andcommitted
Renamed lifetimes for better understanding
1 parent 8d530db commit 91a2a80

File tree

1 file changed

+13
-14
lines changed

1 file changed

+13
-14
lines changed

src/librustc_codegen_llvm/context.rs

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,14 @@ use abi::Abi;
4545
/// There is one `CodegenCx` per compilation unit. Each one has its own LLVM
4646
/// `llvm::Context` so that several compilation units may be optimized in parallel.
4747
/// All other LLVM data structures in the `CodegenCx` are tied to that `llvm::Context`.
48-
pub struct CodegenCx<'a, 'tcx: 'a, V = &'a Value> {
49-
pub tcx: TyCtxt<'a, 'tcx, 'tcx>,
48+
pub struct CodegenCx<'ll, 'tcx: 'll, V = &'ll Value> {
49+
pub tcx: TyCtxt<'ll, 'tcx, 'tcx>,
5050
pub check_overflow: bool,
5151
pub use_dll_storage_attrs: bool,
5252
pub tls_model: llvm::ThreadLocalMode,
5353

54-
pub llmod: &'a llvm::Module,
55-
pub llcx: &'a llvm::Context,
54+
pub llmod: &'ll llvm::Module,
55+
pub llcx: &'ll llvm::Context,
5656
pub stats: RefCell<Stats>,
5757
pub codegen_unit: Arc<CodegenUnit<'tcx>>,
5858

@@ -86,12 +86,12 @@ pub struct CodegenCx<'a, 'tcx: 'a, V = &'a Value> {
8686
/// See http://llvm.org/docs/LangRef.html#the-llvm-used-global-variable for details
8787
pub used_statics: RefCell<Vec<V>>,
8888

89-
pub lltypes: RefCell<FxHashMap<(Ty<'tcx>, Option<VariantIdx>), &'a Type>>,
90-
pub scalar_lltypes: RefCell<FxHashMap<Ty<'tcx>, &'a Type>>,
89+
pub lltypes: RefCell<FxHashMap<(Ty<'tcx>, Option<VariantIdx>), &'ll Type>>,
90+
pub scalar_lltypes: RefCell<FxHashMap<Ty<'tcx>, &'ll Type>>,
9191
pub pointee_infos: RefCell<FxHashMap<(Ty<'tcx>, Size), Option<PointeeInfo>>>,
92-
pub isize_ty: &'a Type,
92+
pub isize_ty: &'ll Type,
9393

94-
pub dbg_cx: Option<debuginfo::CrateDebugContext<'a, 'tcx>>,
94+
pub dbg_cx: Option<debuginfo::CrateDebugContext<'ll, 'tcx>>,
9595

9696
eh_personality: Cell<Option<V>>,
9797
eh_unwind_resume: Cell<Option<V>>,
@@ -103,8 +103,7 @@ pub struct CodegenCx<'a, 'tcx: 'a, V = &'a Value> {
103103
local_gen_sym_counter: Cell<usize>,
104104
}
105105

106-
impl<'a, 'tcx> DepGraphSafe for CodegenCx<'a, 'tcx> {
107-
}
106+
impl<'ll, 'tcx> DepGraphSafe for CodegenCx<'ll, 'tcx> {}
108107

109108
pub fn get_reloc_model(sess: &Session) -> llvm::RelocMode {
110109
let reloc_model_arg = match sess.opts.cg.relocation_model {
@@ -217,11 +216,11 @@ pub unsafe fn create_module(
217216
llmod
218217
}
219218

220-
impl<'a, 'tcx> CodegenCx<'a, 'tcx> {
221-
crate fn new(tcx: TyCtxt<'a, 'tcx, 'tcx>,
219+
impl<'ll, 'tcx> CodegenCx<'ll, 'tcx> {
220+
crate fn new(tcx: TyCtxt<'ll, 'tcx, 'tcx>,
222221
codegen_unit: Arc<CodegenUnit<'tcx>>,
223-
llvm_module: &'a ::ModuleLlvm)
224-
-> CodegenCx<'a, 'tcx> {
222+
llvm_module: &'ll ::ModuleLlvm)
223+
-> Self {
225224
// An interesting part of Windows which MSVC forces our hand on (and
226225
// apparently MinGW didn't) is the usage of `dllimport` and `dllexport`
227226
// attributes in LLVM IR as well as native dependencies (in C these

0 commit comments

Comments
 (0)