Skip to content

Commit 3315edf

Browse files
Adapted trans::common::{block, fn_ctxt, scope_info} to new naming convention.
1 parent 69a237e commit 3315edf

20 files changed

+657
-660
lines changed

src/librustc/middle/trans/_match.rs

+51-51
Large diffs are not rendered by default.

src/librustc/middle/trans/adt.rs

+10-10
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ pub struct Struct {
106106
* these, for places in trans where the `ty::t` isn't directly
107107
* available.
108108
*/
109-
pub fn represent_node(bcx: block, node: ast::node_id) -> @Repr {
109+
pub fn represent_node(bcx: @mut Block, node: ast::node_id) -> @Repr {
110110
represent_type(bcx.ccx(), node_id_type(bcx, node))
111111
}
112112

@@ -283,7 +283,7 @@ fn struct_llfields(cx: &mut CrateContext, st: &Struct, sizing: bool) -> ~[Type]
283283
*
284284
* This should ideally be less tightly tied to `_match`.
285285
*/
286-
pub fn trans_switch(bcx: block, r: &Repr, scrutinee: ValueRef)
286+
pub fn trans_switch(bcx: @mut Block, r: &Repr, scrutinee: ValueRef)
287287
-> (_match::branch_kind, Option<ValueRef>) {
288288
match *r {
289289
CEnum(*) | General(*) => {
@@ -301,7 +301,7 @@ pub fn trans_switch(bcx: block, r: &Repr, scrutinee: ValueRef)
301301

302302

303303
/// Obtain the actual discriminant of a value.
304-
pub fn trans_get_discr(bcx: block, r: &Repr, scrutinee: ValueRef)
304+
pub fn trans_get_discr(bcx: @mut Block, r: &Repr, scrutinee: ValueRef)
305305
-> ValueRef {
306306
match *r {
307307
CEnum(min, max) => load_discr(bcx, scrutinee, min, max),
@@ -315,7 +315,7 @@ pub fn trans_get_discr(bcx: block, r: &Repr, scrutinee: ValueRef)
315315
}
316316
}
317317

318-
fn nullable_bitdiscr(bcx: block, nonnull: &Struct, nndiscr: int, ptrfield: uint,
318+
fn nullable_bitdiscr(bcx: @mut Block, nonnull: &Struct, nndiscr: int, ptrfield: uint,
319319
scrutinee: ValueRef) -> ValueRef {
320320
let cmp = if nndiscr == 0 { IntEQ } else { IntNE };
321321
let llptr = Load(bcx, GEPi(bcx, scrutinee, [0, ptrfield]));
@@ -324,7 +324,7 @@ fn nullable_bitdiscr(bcx: block, nonnull: &Struct, nndiscr: int, ptrfield: uint,
324324
}
325325

326326
/// Helper for cases where the discriminant is simply loaded.
327-
fn load_discr(bcx: block, scrutinee: ValueRef, min: int, max: int)
327+
fn load_discr(bcx: @mut Block, scrutinee: ValueRef, min: int, max: int)
328328
-> ValueRef {
329329
let ptr = GEPi(bcx, scrutinee, [0, 0]);
330330
if max + 1 == min {
@@ -348,7 +348,7 @@ fn load_discr(bcx: block, scrutinee: ValueRef, min: int, max: int)
348348
*
349349
* This should ideally be less tightly tied to `_match`.
350350
*/
351-
pub fn trans_case(bcx: block, r: &Repr, discr: int) -> _match::opt_result {
351+
pub fn trans_case(bcx: @mut Block, r: &Repr, discr: int) -> _match::opt_result {
352352
match *r {
353353
CEnum(*) => {
354354
_match::single_result(rslt(bcx, C_int(bcx.ccx(), discr)))
@@ -371,7 +371,7 @@ pub fn trans_case(bcx: block, r: &Repr, discr: int) -> _match::opt_result {
371371
* representation. The fields, if any, should then be initialized via
372372
* `trans_field_ptr`.
373373
*/
374-
pub fn trans_start_init(bcx: block, r: &Repr, val: ValueRef, discr: int) {
374+
pub fn trans_start_init(bcx: @mut Block, r: &Repr, val: ValueRef, discr: int) {
375375
match *r {
376376
CEnum(min, max) => {
377377
assert!(min <= discr && discr <= max);
@@ -417,7 +417,7 @@ pub fn num_args(r: &Repr, discr: int) -> uint {
417417
}
418418

419419
/// Access a field, at a point when the value's case is known.
420-
pub fn trans_field_ptr(bcx: block, r: &Repr, val: ValueRef, discr: int,
420+
pub fn trans_field_ptr(bcx: @mut Block, r: &Repr, val: ValueRef, discr: int,
421421
ix: uint) -> ValueRef {
422422
// Note: if this ever needs to generate conditionals (e.g., if we
423423
// decide to do some kind of cdr-coding-like non-unique repr
@@ -449,7 +449,7 @@ pub fn trans_field_ptr(bcx: block, r: &Repr, val: ValueRef, discr: int,
449449
}
450450
}
451451

452-
fn struct_field_ptr(bcx: block, st: &Struct, val: ValueRef, ix: uint,
452+
fn struct_field_ptr(bcx: @mut Block, st: &Struct, val: ValueRef, ix: uint,
453453
needs_cast: bool) -> ValueRef {
454454
let ccx = bcx.ccx();
455455

@@ -467,7 +467,7 @@ fn struct_field_ptr(bcx: block, st: &Struct, val: ValueRef, ix: uint,
467467
}
468468

469469
/// Access the struct drop flag, if present.
470-
pub fn trans_drop_flag_ptr(bcx: block, r: &Repr, val: ValueRef) -> ValueRef {
470+
pub fn trans_drop_flag_ptr(bcx: @mut Block, r: &Repr, val: ValueRef) -> ValueRef {
471471
match *r {
472472
Univariant(ref st, true) => GEPi(bcx, val, [0, st.fields.len() - 1]),
473473
_ => bcx.ccx().sess.bug("tried to get drop flag of non-droppable type")

src/librustc/middle/trans/asm.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ use std::str;
2525
use syntax::ast;
2626

2727
// Take an inline assembly expression and splat it out via LLVM
28-
pub fn trans_inline_asm(bcx: block, ia: &ast::inline_asm) -> block {
28+
pub fn trans_inline_asm(bcx: @mut Block, ia: &ast::inline_asm) -> @mut Block {
2929

3030
let mut bcx = bcx;
3131
let mut constraints = ~[];

0 commit comments

Comments
 (0)