Renamed lifetimes for better understanding
This commit is contained in:
parent
8d530db2c5
commit
91a2a80692
1 changed files with 13 additions and 14 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue