about summary refs log tree commit diff
diff options
context:
space:
mode:
authorCohenArthur <arthur.cohen@epita.fr>2020-08-22 15:18:10 +0200
committerCohenArthur <arthur.cohen@epita.fr>2020-08-22 15:18:10 +0200
commit5a59c24eeee2097ff64b0578704a5eb7a4dd07f8 (patch)
tree8cf2bf2400b917715c001d2ca15c64717ed9aaf9
parente64f523b2750ef8275ad9d1625afab6d9707898a (diff)
downloadrust-5a59c24eeee2097ff64b0578704a5eb7a4dd07f8.tar.gz
rust-5a59c24eeee2097ff64b0578704a5eb7a4dd07f8.zip
FunctionCx: Store reference to CodegenCx instead
-rw-r--r--src/common.rs5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/common.rs b/src/common.rs
index 42131581088..a575f03e350 100644
--- a/src/common.rs
+++ b/src/common.rs
@@ -265,9 +265,7 @@ pub(crate) fn type_sign(ty: Ty<'_>) -> bool {
 }
 
 pub(crate) struct FunctionCx<'clif, 'tcx, B: Backend + 'static> {
-    // FIXME use a reference to `CodegenCx` instead of `tcx`, `module` and `constants` and `caches`
-    pub(crate) tcx: TyCtxt<'tcx>,
-    pub(crate) module: &'clif mut Module<B>,
+    pub(crate) codegen_cx: &'clif CodegenCx<'tcx, B>,
     pub(crate) global_asm: &'clif mut String,
     pub(crate) pointer_type: Type, // Cached from module
 
@@ -285,7 +283,6 @@ pub(crate) struct FunctionCx<'clif, 'tcx, B: Backend + 'static> {
     pub(crate) cold_blocks: EntitySet<Block>,
 
     pub(crate) clif_comments: crate::pretty_clif::CommentWriter,
-    pub(crate) constants_cx: &'clif mut crate::constant::ConstantCx,
     pub(crate) vtables: &'clif mut FxHashMap<(Ty<'tcx>, Option<ty::PolyExistentialTraitRef<'tcx>>), DataId>,
 
     pub(crate) source_info_set: indexmap::IndexSet<SourceInfo>,