Skip to content

Commit 5c53959

Browse files
committed
Make bcx_tcx-style accessors return by reference
1 parent 00daeb4 commit 5c53959

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/comp/middle/trans_common.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -449,14 +449,14 @@ fn find_scope_cx(cx: @block_ctxt) -> @block_ctxt {
449449
// Accessors
450450
// TODO: When we have overloading, simplify these names!
451451

452-
pure fn bcx_tcx(bcx: @block_ctxt) -> ty::ctxt { bcx.fcx.lcx.ccx.tcx }
453-
pure fn bcx_ccx(bcx: @block_ctxt) -> @crate_ctxt { bcx.fcx.lcx.ccx }
454-
pure fn bcx_lcx(bcx: @block_ctxt) -> @local_ctxt { bcx.fcx.lcx }
455-
pure fn bcx_fcx(bcx: @block_ctxt) -> @fn_ctxt { bcx.fcx }
456-
pure fn fcx_ccx(fcx: @fn_ctxt) -> @crate_ctxt { fcx.lcx.ccx }
457-
pure fn fcx_tcx(fcx: @fn_ctxt) -> ty::ctxt { fcx.lcx.ccx.tcx }
458-
pure fn lcx_ccx(lcx: @local_ctxt) -> @crate_ctxt { lcx.ccx }
459-
pure fn ccx_tcx(ccx: @crate_ctxt) -> ty::ctxt { ccx.tcx }
452+
pure fn bcx_tcx(bcx: @block_ctxt) -> &ty::ctxt { ret bcx.fcx.lcx.ccx.tcx; }
453+
pure fn bcx_ccx(bcx: @block_ctxt) -> &@crate_ctxt { ret bcx.fcx.lcx.ccx; }
454+
pure fn bcx_lcx(bcx: @block_ctxt) -> &@local_ctxt { ret bcx.fcx.lcx; }
455+
pure fn bcx_fcx(bcx: @block_ctxt) -> &@fn_ctxt { ret bcx.fcx; }
456+
pure fn fcx_ccx(fcx: @fn_ctxt) -> &@crate_ctxt { ret fcx.lcx.ccx; }
457+
pure fn fcx_tcx(fcx: @fn_ctxt) -> &ty::ctxt { ret fcx.lcx.ccx.tcx; }
458+
pure fn lcx_ccx(lcx: @local_ctxt) -> &@crate_ctxt { ret lcx.ccx; }
459+
pure fn ccx_tcx(ccx: @crate_ctxt) -> &ty::ctxt { ret ccx.tcx; }
460460

461461
// LLVM type constructors.
462462
fn T_void() -> TypeRef {

0 commit comments

Comments
 (0)