13
13
// but many TypeRefs correspond to one ty::t; for instance, tup(int, int,
14
14
// int) and rec(x=int, y=int, z=int) will have the same TypeRef.
15
15
16
- import libc:: c_uint;
16
+ import libc:: { c_uint, c_ulonglong } ;
17
17
import std:: { map, time, list} ;
18
18
import std:: map:: hashmap;
19
19
import std:: map:: { int_hash, str_hash} ;
@@ -450,25 +450,25 @@ fn get_static_tydesc(ccx: @crate_ctxt, t: ty::t) -> @tydesc_info {
450
450
}
451
451
452
452
fn set_no_inline ( f : ValueRef ) {
453
- llvm:: LLVMAddFunctionAttr ( f, lib:: llvm:: NoInlineAttribute as c_uint ,
454
- 0 u as c_uint ) ;
453
+ llvm:: LLVMAddFunctionAttr ( f, lib:: llvm:: NoInlineAttribute as c_ulonglong ,
454
+ 0 u as c_ulonglong ) ;
455
455
}
456
456
457
457
fn set_no_unwind ( f : ValueRef ) {
458
- llvm:: LLVMAddFunctionAttr ( f, lib:: llvm:: NoUnwindAttribute as c_uint ,
459
- 0 u as c_uint ) ;
458
+ llvm:: LLVMAddFunctionAttr ( f, lib:: llvm:: NoUnwindAttribute as c_ulonglong ,
459
+ 0 u as c_ulonglong ) ;
460
460
}
461
461
462
462
// Tell LLVM to emit the information necessary to unwind the stack for the
463
463
// function f.
464
464
fn set_uwtable ( f : ValueRef ) {
465
- llvm:: LLVMAddFunctionAttr ( f, lib:: llvm:: UWTableAttribute as c_uint ,
466
- 0 u as c_uint ) ;
465
+ llvm:: LLVMAddFunctionAttr ( f, lib:: llvm:: UWTableAttribute as c_ulonglong ,
466
+ 0 u as c_ulonglong ) ;
467
467
}
468
468
469
469
fn set_inline_hint ( f : ValueRef ) {
470
- llvm:: LLVMAddFunctionAttr ( f, lib:: llvm:: InlineHintAttribute as c_uint ,
471
- 0 u as c_uint ) ;
470
+ llvm:: LLVMAddFunctionAttr ( f, lib:: llvm:: InlineHintAttribute
471
+ as c_ulonglong , 0 u as c_ulonglong ) ;
472
472
}
473
473
474
474
fn set_inline_hint_if_appr ( attrs : [ ast:: attribute ] ,
@@ -481,13 +481,12 @@ fn set_inline_hint_if_appr(attrs: [ast::attribute],
481
481
}
482
482
483
483
fn set_always_inline ( f : ValueRef ) {
484
- llvm:: LLVMAddFunctionAttr ( f, lib:: llvm:: AlwaysInlineAttribute as c_uint ,
485
- 0 u as c_uint ) ;
484
+ llvm:: LLVMAddFunctionAttr ( f, lib:: llvm:: AlwaysInlineAttribute
485
+ as c_ulonglong , 0 u as c_ulonglong ) ;
486
486
}
487
487
488
488
fn set_custom_stack_growth_fn ( f : ValueRef ) {
489
- // FIXME: Remove this hack to work around the lack of u64 in the FFI.
490
- llvm:: LLVMAddFunctionAttr ( f, 0 u as c_uint , 1 u as c_uint ) ;
489
+ llvm:: LLVMAddFunctionAttr ( f, 0 u as c_ulonglong , 1 u as c_ulonglong ) ;
491
490
}
492
491
493
492
fn set_glue_inlining ( f : ValueRef , t : ty:: t ) {
@@ -1343,7 +1342,7 @@ fn call_memmove(cx: block, dst: ValueRef, src: ValueRef,
1343
1342
// FIXME: Provide LLVM with better alignment information when the
1344
1343
// alignment is statically known (it must be nothing more than a constant
1345
1344
// int, or LLVM complains -- not even a constant element of a tydesc
1346
- // works).
1345
+ // works). (Related to #1645, I think?)
1347
1346
let _icx = cx. insn_ctxt ( "call_memmove" ) ;
1348
1347
let ccx = cx. ccx ( ) ;
1349
1348
let key = alt ccx. sess . targ_cfg . arch {
@@ -1428,7 +1427,7 @@ fn copy_val_no_check(bcx: block, action: copy_action, dst: ValueRef,
1428
1427
// Since it needs to zero out the source, src also needs to be an lval.
1429
1428
// FIXME: We always zero out the source. Ideally we would detect the
1430
1429
// case where a variable is always deinitialized by block exit and thus
1431
- // doesn't need to be dropped.
1430
+ // doesn't need to be dropped. (Issue #839)
1432
1431
fn move_val ( cx : block , action : copy_action , dst : ValueRef ,
1433
1432
src : lval_result , t : ty:: t ) -> block {
1434
1433
let _icx = cx. insn_ctxt ( "move_val" ) ;
@@ -1623,7 +1622,7 @@ fn cast_shift_rhs(op: ast::binop,
1623
1622
trunc ( rhs, lhs_llty)
1624
1623
} else if lhs_sz > rhs_sz {
1625
1624
// FIXME: If shifting by negative values becomes not undefined
1626
- // then this is wrong.
1625
+ // then this is wrong. (See discussion at #1570)
1627
1626
zext ( rhs, lhs_llty)
1628
1627
} else {
1629
1628
rhs
@@ -1713,6 +1712,7 @@ fn trans_assign_op(bcx: block, ex: @ast::expr, op: ast::binop,
1713
1712
expr_ty ( bcx, ex) ,
1714
1713
{ |bcx|
1715
1714
// FIXME provide the already-computed address, not the expr
1715
+ // #2528
1716
1716
impl:: trans_method_callee ( bcx, callee_id, dst, origin)
1717
1717
} ,
1718
1718
arg_exprs ( [ src] ) , save_in ( lhs_res. val ) ) ;
@@ -2006,7 +2006,7 @@ fn trans_external_path(ccx: @crate_ctxt, did: ast::def_id, t: ty::t)
2006
2006
}
2007
2007
2008
2008
fn normalize_for_monomorphization ( tcx : ty:: ctxt , ty : ty:: t ) -> option < ty:: t > {
2009
- // FIXME[mono] could do this recursively. is that worthwhile?
2009
+ // FIXME[mono] could do this recursively. is that worthwhile? (#2529)
2010
2010
alt ty:: get ( ty) . struct {
2011
2011
ty:: ty_box ( mt) { some ( ty:: mk_opaque_box ( tcx) ) }
2012
2012
ty:: ty_fn ( fty) { some ( ty:: mk_fn ( tcx, { purity: ast:: impure_fn,
@@ -2379,7 +2379,7 @@ fn lval_static_fn_inner(bcx: block, fn_id: ast::def_id, id: ast::node_id,
2379
2379
ccx, node_id_type ( bcx, id) ) ) ) ;
2380
2380
}
2381
2381
2382
- // FIXME: Need to support external crust functions
2382
+ // FIXME: Need to support external crust functions (#1840)
2383
2383
if fn_id. crate == ast:: local_crate {
2384
2384
alt bcx. tcx ( ) . def_map . find ( id) {
2385
2385
some ( ast:: def_fn ( _, ast:: crust_fn) ) {
@@ -2480,10 +2480,7 @@ fn trans_var(cx: block, def: ast::def, id: ast::node_id)-> lval_maybe_callee {
2480
2480
} else {
2481
2481
// Nullary variant.
2482
2482
let enum_ty = node_id_type ( cx, id) ;
2483
- let llenumblob = alloc_ty ( cx, enum_ty) ;
2484
- // FIXME: This pointer cast probably isn't necessary
2485
- let llenumty = type_of ( ccx, enum_ty) ;
2486
- let llenumptr = PointerCast ( cx, llenumblob, T_ptr ( llenumty) ) ;
2483
+ let llenumptr = alloc_ty ( cx, enum_ty) ;
2487
2484
let lldiscrimptr = GEPi ( cx, llenumptr, [ 0 u, 0 u] ) ;
2488
2485
let lldiscrim_gv = lookup_discriminant ( ccx, vid) ;
2489
2486
let lldiscrim = Load ( cx, lldiscrim_gv) ;
@@ -3666,7 +3663,7 @@ fn trans_expr(bcx: block, e: @ast::expr, dest: dest) -> block {
3666
3663
expr_ty ( bcx, src) , is_last_use) ;
3667
3664
}
3668
3665
ast:: expr_move ( dst, src) {
3669
- // FIXME: calculate copy init-ness in typestate.
3666
+ // FIXME: calculate copy init-ness in typestate. (#839)
3670
3667
assert dest == ignore;
3671
3668
let src_r = trans_temp_lval ( bcx, src) ;
3672
3669
let { bcx, val: addr , kind } = trans_lval ( src_r. bcx , dst) ;
@@ -4650,7 +4647,7 @@ fn trans_enum_variant(ccx: @crate_ctxt, enum_id: ast::node_id,
4650
4647
4651
4648
// FIXME: this should do some structural hash-consing to avoid
4652
4649
// duplicate constants. I think. Maybe LLVM has a magical mode
4653
- // that does so later on?
4650
+ // that does so later on? (#2530)
4654
4651
fn trans_const_expr ( cx : @crate_ctxt , e : @ast:: expr ) -> ValueRef {
4655
4652
let _icx = cx. insn_ctxt ( "trans_const_expr" ) ;
4656
4653
alt e. node {
@@ -4754,7 +4751,7 @@ fn trans_const_expr(cx: @crate_ctxt, e: @ast::expr) -> ValueRef {
4754
4751
} , _) {
4755
4752
// FIXME: Instead of recursing here to regenerate the values
4756
4753
// for other constants, we should just look up the
4757
- // already-defined value
4754
+ // already-defined value (#2530)
4758
4755
trans_const_expr ( cx, subexpr)
4759
4756
}
4760
4757
_ {
@@ -4800,7 +4797,6 @@ fn trans_class_ctor(ccx: @crate_ctxt, path: path, decl: ast::fn_decl,
4800
4797
// Make the fn context
4801
4798
let fcx = new_fn_ctxt_w_id ( ccx, path, llctor_decl, ctor_id,
4802
4799
some ( psubsts) , some ( sp) ) ;
4803
- // FIXME: need to substitute into the fn arg types too?
4804
4800
create_llargs_for_fn_args ( fcx, no_self, decl. inputs ) ;
4805
4801
let mut bcx_top = top_scope_block ( fcx, body. info ( ) ) ;
4806
4802
let lltop = bcx_top. llbb ;
@@ -4953,8 +4949,6 @@ fn trans_item(ccx: @crate_ctxt, item: ast::item) {
4953
4949
ast:: item_class ( tps, _ifaces, items, ctor, m_dtor, _) {
4954
4950
if tps. len ( ) == 0 u {
4955
4951
let psubsts = { tys: ty:: ty_params_to_tys ( ccx. tcx , tps) ,
4956
- // FIXME: vtables have to get filled in depending
4957
- // on ifaces
4958
4952
vtables: none,
4959
4953
bounds: @[ ] } ;
4960
4954
trans_class_ctor ( ccx, * path, ctor. node . dec , ctor. node . body ,
0 commit comments