From be981dce80f6d115b04a6898bb2d6bf316dc402d Mon Sep 17 00:00:00 2001 From: Mark-Simulacrum Date: Fri, 16 Dec 2016 11:32:59 -0700 Subject: [PATCH] Start FunctionContext privatization and reduction --- src/librustc_trans/common.rs | 10 +++------- src/librustc_trans/mir/mod.rs | 2 +- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/src/librustc_trans/common.rs b/src/librustc_trans/common.rs index e2abb7779c98..1025f9d4051f 100644 --- a/src/librustc_trans/common.rs +++ b/src/librustc_trans/common.rs @@ -269,7 +269,7 @@ pub struct FunctionContext<'a, 'tcx: 'a> { pub llfn: ValueRef, // always an empty parameter-environment NOTE: @jroesch another use of ParamEnv - pub param_env: ty::ParameterEnvironment<'tcx>, + param_env: ty::ParameterEnvironment<'tcx>, // A pointer to where to store the return value. If the return type is // immediate, this points to an alloca in the function. Otherwise, it's a @@ -314,8 +314,8 @@ pub struct FunctionContext<'a, 'tcx: 'a> { impl<'a, 'tcx> FunctionContext<'a, 'tcx> { /// Create a function context for the given function. - /// Beware that you must call `fcx.init` or `fcx.bind_args` - /// before doing anything with the returned function context. + /// Beware that you must call `fcx.init` before doing anything with the returned function + /// context. pub fn new(ccx: &'a CrateContext<'a, 'tcx>, llfndecl: ValueRef, fn_ty: FnType, @@ -603,10 +603,6 @@ impl<'blk, 'tcx> BlockAndBuilder<'blk, 'tcx> { pub fn llbb(&self) -> BasicBlockRef { self.llbb } - - pub fn mir(&self) -> Ref<'tcx, Mir<'tcx>> { - self.fcx.mir() - } } impl<'blk, 'tcx> Deref for BlockAndBuilder<'blk, 'tcx> { diff --git a/src/librustc_trans/mir/mod.rs b/src/librustc_trans/mir/mod.rs index 60fd80a8f902..c3cc5a7a9b39 100644 --- a/src/librustc_trans/mir/mod.rs +++ b/src/librustc_trans/mir/mod.rs @@ -182,7 +182,7 @@ impl<'tcx> LocalRef<'tcx> { pub fn trans_mir<'blk, 'tcx: 'blk>(fcx: &'blk FunctionContext<'blk, 'tcx>) { let bcx = fcx.init(true); - let mir = bcx.mir(); + let mir = fcx.mir(); // Analyze the temps to determine which must be lvalues // FIXME