Skip to content

Commit 440f2fb

Browse files
committed
Renamed lifetimes for better understanding
1 parent df5a57c commit 440f2fb

File tree

1 file changed

+14
-15
lines changed

1 file changed

+14
-15
lines changed

src/librustc_codegen_llvm/context.rs

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

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

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

90-
pub lltypes: RefCell<FxHashMap<(Ty<'tcx>, Option<usize>), &'a Type>>,
91-
pub scalar_lltypes: RefCell<FxHashMap<Ty<'tcx>, &'a Type>>,
90+
pub lltypes: RefCell<FxHashMap<(Ty<'tcx>, Option<usize>), &'ll Type>>,
91+
pub scalar_lltypes: RefCell<FxHashMap<Ty<'tcx>, &'ll Type>>,
9292
pub pointee_infos: RefCell<FxHashMap<(Ty<'tcx>, Size), Option<PointeeInfo>>>,
93-
pub isize_ty: &'a Type,
93+
pub isize_ty: &'ll Type,
9494

95-
pub dbg_cx: Option<debuginfo::CrateDebugContext<'a, 'tcx>>,
95+
pub dbg_cx: Option<debuginfo::CrateDebugContext<'ll, 'tcx>>,
9696

9797
eh_personality: Cell<Option<V>>,
9898
eh_unwind_resume: Cell<Option<V>>,
@@ -104,8 +104,7 @@ pub struct CodegenCx<'a, 'tcx: 'a, V> {
104104
local_gen_sym_counter: Cell<usize>,
105105
}
106106

107-
impl<'a, 'tcx, Value> DepGraphSafe for CodegenCx<'a, 'tcx, Value> {
108-
}
107+
impl<'ll, 'tcx, Value> DepGraphSafe for CodegenCx<'ll, 'tcx, Value> {}
109108

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

221-
impl<'a, 'tcx, Value : Eq+Hash> CodegenCx<'a, 'tcx, Value> {
222-
crate fn new(tcx: TyCtxt<'a, 'tcx, 'tcx>,
220+
impl<'ll, 'tcx, Value : Eq+Hash> CodegenCx<'ll, 'tcx, Value> {
221+
crate fn new(tcx: TyCtxt<'ll, 'tcx, 'tcx>,
223222
codegen_unit: Arc<CodegenUnit<'tcx>>,
224-
llvm_module: &'a ::ModuleLlvm)
225-
-> CodegenCx<'a, 'tcx, Value> {
223+
llvm_module: &'ll ::ModuleLlvm)
224+
-> CodegenCx<'ll, 'tcx, Value> {
226225
// An interesting part of Windows which MSVC forces our hand on (and
227226
// apparently MinGW didn't) is the usage of `dllimport` and `dllexport`
228227
// attributes in LLVM IR as well as native dependencies (in C these
@@ -446,7 +445,7 @@ impl IntrinsicDeclarationMethods<'b> for CodegenCx<'b, 'tcx, &'b Value> {
446445

447446
declare_intrinsic(self, key).unwrap_or_else(|| bug!("unknown intrinsic '{}'", key))
448447
}
449-
448+
450449
fn declare_intrinsic(
451450
&self,
452451
key: &str

0 commit comments

Comments
 (0)