Skip to content

Commit c8f296d

Browse files
committed
---
yaml --- r: 147610 b: refs/heads/try2 c: 8ae01fc h: refs/heads/master v: v3
1 parent ee0b444 commit c8f296d

File tree

4 files changed

+18
-19
lines changed

4 files changed

+18
-19
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: 558099b5093b9094d13b99e5bec4e71a8f02e01f
8+
refs/heads/try2: 8ae01fc0ae8ee160a5713873177f9fc9957be8ab
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/src/librustc/middle/trans/base.rs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1188,7 +1188,7 @@ pub fn trans_stmt(cx: @Block, s: &ast::Stmt) -> @Block {
11881188

11891189
// You probably don't want to use this one. See the
11901190
// next three functions instead.
1191-
pub fn new_block(cx: @mut FunctionContext,
1191+
pub fn new_block(cx: @FunctionContext,
11921192
parent: Option<@Block>,
11931193
scope: Option<@mut ScopeInfo>,
11941194
is_lpad: bool,
@@ -1229,7 +1229,7 @@ pub fn simple_block_scope(parent: Option<@mut ScopeInfo>,
12291229
}
12301230

12311231
// Use this when you're at the top block of a function or the like.
1232-
pub fn top_scope_block(fcx: @mut FunctionContext, opt_node_info: Option<NodeInfo>)
1232+
pub fn top_scope_block(fcx: @FunctionContext, opt_node_info: Option<NodeInfo>)
12331233
-> @Block {
12341234
return new_block(fcx, None, Some(simple_block_scope(None, opt_node_info)), false,
12351235
"function top level", opt_node_info);
@@ -1268,7 +1268,7 @@ pub fn sub_block(bcx: @Block, n: &str) -> @Block {
12681268
new_block(bcx.fcx, Some(bcx), None, bcx.is_lpad, n, None)
12691269
}
12701270

1271-
pub fn raw_block(fcx: @mut FunctionContext, is_lpad: bool, llbb: BasicBlockRef) -> @Block {
1271+
pub fn raw_block(fcx: @FunctionContext, is_lpad: bool, llbb: BasicBlockRef) -> @Block {
12721272
@Block::new(llbb, None, is_lpad, None, fcx)
12731273
}
12741274

@@ -1635,7 +1635,7 @@ pub fn mk_return_basic_block(llfn: ValueRef) -> BasicBlockRef {
16351635

16361636
// Creates and returns space for, or returns the argument representing, the
16371637
// slot where the return value of the function must go.
1638-
pub fn make_return_pointer(fcx: @mut FunctionContext, output_type: ty::t) -> ValueRef {
1638+
pub fn make_return_pointer(fcx: @FunctionContext, output_type: ty::t) -> ValueRef {
16391639
unsafe {
16401640
if type_of::return_uses_outptr(fcx.ccx, output_type) {
16411641
llvm::LLVMGetParam(fcx.llfn, 0)
@@ -1662,7 +1662,7 @@ pub fn new_fn_ctxt_w_id(ccx: @CrateContext,
16621662
param_substs: Option<@param_substs>,
16631663
opt_node_info: Option<NodeInfo>,
16641664
sp: Option<Span>)
1665-
-> @mut FunctionContext {
1665+
-> @FunctionContext {
16661666
for p in param_substs.iter() { p.validate(); }
16671667

16681668
debug!("new_fn_ctxt_w_id(path={}, id={:?}, \
@@ -1680,7 +1680,7 @@ pub fn new_fn_ctxt_w_id(ccx: @CrateContext,
16801680
let uses_outptr = type_of::return_uses_outptr(ccx, substd_output_type);
16811681
let debug_context = debuginfo::create_function_debug_context(ccx, id, param_substs, llfndecl);
16821682

1683-
let fcx = @mut FunctionContext {
1683+
let fcx = @FunctionContext {
16841684
llfn: llfndecl,
16851685
llenv: unsafe {
16861686
Cell::new(llvm::LLVMGetUndef(Type::i8p().to_ref()))
@@ -1734,7 +1734,7 @@ pub fn new_fn_ctxt(ccx: @CrateContext,
17341734
llfndecl: ValueRef,
17351735
output_type: ty::t,
17361736
sp: Option<Span>)
1737-
-> @mut FunctionContext {
1737+
-> @FunctionContext {
17381738
new_fn_ctxt_w_id(ccx, path, llfndecl, -1, output_type, false, None, None, sp)
17391739
}
17401740

@@ -1752,7 +1752,7 @@ pub fn new_fn_ctxt(ccx: @CrateContext,
17521752
// spaces that have been created for them (by code in the llallocas field of
17531753
// the function's fn_ctxt). create_llargs_for_fn_args populates the llargs
17541754
// field of the fn_ctxt with
1755-
pub fn create_llargs_for_fn_args(cx: @mut FunctionContext,
1755+
pub fn create_llargs_for_fn_args(cx: @FunctionContext,
17561756
self_arg: self_arg,
17571757
args: &[ast::arg])
17581758
-> ~[ValueRef] {
@@ -1776,7 +1776,7 @@ pub fn create_llargs_for_fn_args(cx: @mut FunctionContext,
17761776
})
17771777
}
17781778

1779-
pub fn copy_args_to_allocas(fcx: @mut FunctionContext,
1779+
pub fn copy_args_to_allocas(fcx: @FunctionContext,
17801780
bcx: @Block,
17811781
args: &[ast::arg],
17821782
raw_llargs: &[ValueRef],
@@ -1840,7 +1840,7 @@ pub fn copy_args_to_allocas(fcx: @mut FunctionContext,
18401840

18411841
// Ties up the llstaticallocas -> llloadenv -> lltop edges,
18421842
// and builds the return block.
1843-
pub fn finish_fn(fcx: @mut FunctionContext, last_bcx: @Block) {
1843+
pub fn finish_fn(fcx: @FunctionContext, last_bcx: @Block) {
18441844
let _icx = push_ctxt("finish_fn");
18451845

18461846
let ret_cx = match fcx.llreturn.get() {
@@ -1901,7 +1901,7 @@ pub fn trans_closure(ccx: @CrateContext,
19011901
id: ast::NodeId,
19021902
_attributes: &[ast::Attribute],
19031903
output_type: ty::t,
1904-
maybe_load_env: |@mut FunctionContext|) {
1904+
maybe_load_env: |@FunctionContext|) {
19051905
ccx.stats.n_closures += 1;
19061906
let _icx = push_ctxt("trans_closure");
19071907
set_uwtable(llfndecl);

branches/try2/src/librustc/middle/trans/closure.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ pub fn build_closure(bcx0: @Block,
293293
// Given an enclosing block context, a new function context, a closure type,
294294
// and a list of upvars, generate code to load and populate the environment
295295
// with the upvars and type descriptors.
296-
pub fn load_environment(fcx: @mut FunctionContext,
296+
pub fn load_environment(fcx: @FunctionContext,
297297
cdata_ty: ty::t,
298298
cap_vars: &[moves::CaptureVar],
299299
sigil: ast::Sigil) {

branches/try2/src/librustc/middle/trans/common.rs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ impl FunctionContext {
289289
}
290290
}
291291

292-
pub fn cleanup(&mut self) {
292+
pub fn cleanup(&self) {
293293
unsafe {
294294
llvm::LLVMInstructionEraseFromParent(self.alloca_insert_pt
295295
.get()
@@ -299,7 +299,7 @@ impl FunctionContext {
299299
self.entry_bcx.set(None);
300300
}
301301

302-
pub fn get_llreturn(&mut self) -> BasicBlockRef {
302+
pub fn get_llreturn(&self) -> BasicBlockRef {
303303
if self.llreturn.get().is_none() {
304304
self.llreturn.set(Some(base::mk_return_basic_block(self.llfn)));
305305
}
@@ -671,17 +671,16 @@ pub struct Block {
671671
node_info: Option<NodeInfo>,
672672
// The function context for the function to which this block is
673673
// attached.
674-
fcx: @mut FunctionContext
674+
fcx: @FunctionContext
675675
}
676676

677677
impl Block {
678-
679678
pub fn new(llbb: BasicBlockRef,
680679
parent: Option<@Block>,
681680
is_lpad: bool,
682681
node_info: Option<NodeInfo>,
683-
fcx: @mut FunctionContext)
684-
-> Block {
682+
fcx: @FunctionContext)
683+
-> Block {
685684
Block {
686685
llbb: llbb,
687686
terminated: Cell::new(false),

0 commit comments

Comments
 (0)