@@ -1073,7 +1073,7 @@ fn set_no_inline(f: ValueRef) {
1073
1073
llvm:: LLVMAddFunctionAttr ( f,
1074
1074
lib:: llvm:: LLVMNoInlineAttribute as
1075
1075
lib:: llvm:: llvm:: Attribute ,
1076
- 0u32 ) ;
1076
+ 0 u as c_uint ) ;
1077
1077
}
1078
1078
1079
1079
// Tell LLVM to emit the information necessary to unwind the stack for the
@@ -1082,19 +1082,20 @@ fn set_uwtable(f: ValueRef) {
1082
1082
llvm:: LLVMAddFunctionAttr ( f,
1083
1083
lib:: llvm:: LLVMUWTableAttribute as
1084
1084
lib:: llvm:: llvm:: Attribute ,
1085
- 0u32 ) ;
1085
+ 0 u as c_uint ) ;
1086
1086
}
1087
1087
1088
1088
fn set_always_inline ( f : ValueRef ) {
1089
1089
llvm:: LLVMAddFunctionAttr ( f,
1090
1090
lib:: llvm:: LLVMAlwaysInlineAttribute as
1091
1091
lib:: llvm:: llvm:: Attribute ,
1092
- 0u32 ) ;
1092
+ 0 u as c_uint ) ;
1093
1093
}
1094
1094
1095
1095
fn set_custom_stack_growth_fn ( f : ValueRef ) {
1096
1096
// TODO: Remove this hack to work around the lack of u64 in the FFI.
1097
- llvm:: LLVMAddFunctionAttr ( f, 0 as lib:: llvm:: llvm:: Attribute , 1u32 ) ;
1097
+ llvm:: LLVMAddFunctionAttr ( f, 0 as lib:: llvm:: llvm:: Attribute ,
1098
+ 1 u as c_uint ) ;
1098
1099
}
1099
1100
1100
1101
fn set_glue_inlining ( cx : @local_ctxt , f : ValueRef , t : ty:: t ) {
@@ -1181,7 +1182,7 @@ fn make_generic_glue_inner(cx: @local_ctxt, sp: span, t: ty::t,
1181
1182
} else { T_ptr ( T_i8 ( ) ) } ;
1182
1183
1183
1184
let ty_param_count = vec:: len :: < uint > ( ty_params) ;
1184
- let lltyparams = llvm:: LLVMGetParam ( llfn, 2u32 ) ;
1185
+ let lltyparams = llvm:: LLVMGetParam ( llfn, 2 u as c_uint ) ;
1185
1186
let load_env_bcx = new_raw_block_ctxt ( fcx, fcx. llloadenv ) ;
1186
1187
let lltydescs = [ mutable] ;
1187
1188
let p = 0 u;
@@ -1196,7 +1197,7 @@ fn make_generic_glue_inner(cx: @local_ctxt, sp: span, t: ty::t,
1196
1197
1197
1198
let bcx = new_top_block_ctxt ( fcx) ;
1198
1199
let lltop = bcx. llbb ;
1199
- let llrawptr0 = llvm:: LLVMGetParam ( llfn, 3u32 ) ;
1200
+ let llrawptr0 = llvm:: LLVMGetParam ( llfn, 3 u as c_uint ) ;
1200
1201
let llval0 = BitCast ( bcx, llrawptr0, llty) ;
1201
1202
helper ( bcx, llval0, t) ;
1202
1203
finish_fn ( fcx, lltop) ;
@@ -4303,8 +4304,8 @@ fn new_fn_ctxt_w_id(cx: @local_ctxt, sp: span, llfndecl: ValueRef,
4303
4304
-> @fn_ctxt {
4304
4305
let llbbs = mk_standard_basic_blocks ( llfndecl) ;
4305
4306
ret @{ llfn : llfndecl,
4306
- llenv : llvm:: LLVMGetParam ( llfndecl, 1u32 ) ,
4307
- llretptr : llvm:: LLVMGetParam ( llfndecl, 0u32 ) ,
4307
+ llenv : llvm:: LLVMGetParam ( llfndecl, 1 u as c_uint ) ,
4308
+ llretptr : llvm:: LLVMGetParam ( llfndecl, 0 u as c_uint ) ,
4308
4309
mutable llstaticallocas : llbbs. sa ,
4309
4310
mutable llloadenv : llbbs. ca ,
4310
4311
mutable llderivedtydescs_first : llbbs. dt ,
@@ -4347,21 +4348,22 @@ fn create_llargs_for_fn_args(cx: @fn_ctxt, ty_self: self_arg,
4347
4348
// Skip the implicit arguments 0, and 1. TODO: Pull out 2u and define
4348
4349
// it as a constant, since we're using it in several places in trans this
4349
4350
// way.
4350
- let arg_n = 2u32 ;
4351
+ let arg_n = 2 u ;
4351
4352
alt ty_self {
4352
4353
impl_self( tt) {
4353
4354
cx. llself = some ( { v: cx. llenv , t: tt} ) ;
4354
4355
}
4355
4356
no_self. { }
4356
4357
}
4357
4358
for tp in ty_params {
4358
- let lltydesc = llvm:: LLVMGetParam ( cx. llfn , arg_n) , dicts = none;
4359
- arg_n += 1u32 ;
4359
+ let lltydesc = llvm:: LLVMGetParam ( cx. llfn , arg_n as c_uint ) ;
4360
+ let dicts = none;
4361
+ arg_n += 1 u;
4360
4362
for bound in * fcx_tcx ( cx) . ty_param_bounds . get ( tp. id ) {
4361
4363
alt bound {
4362
4364
ty : : bound_iface ( _) {
4363
- let dict = llvm:: LLVMGetParam ( cx. llfn , arg_n) ;
4364
- arg_n += 1u32 ;
4365
+ let dict = llvm:: LLVMGetParam ( cx. llfn , arg_n as c_uint ) ;
4366
+ arg_n += 1 u ;
4365
4367
dicts = some ( alt dicts {
4366
4368
none. { [ dict] }
4367
4369
some ( ds) { ds + [ dict] }
@@ -4376,13 +4378,13 @@ fn create_llargs_for_fn_args(cx: @fn_ctxt, ty_self: self_arg,
4376
4378
// Populate the llargs field of the function context with the ValueRefs
4377
4379
// that we get from llvm::LLVMGetParam for each argument.
4378
4380
for arg: ast:: arg in args {
4379
- let llarg = llvm:: LLVMGetParam ( cx. llfn , arg_n) ;
4381
+ let llarg = llvm:: LLVMGetParam ( cx. llfn , arg_n as c_uint ) ;
4380
4382
assert ( llarg as int != 0 ) ;
4381
4383
// Note that this uses local_mem even for things passed by value.
4382
4384
// copy_args_to_allocas will overwrite the table entry with local_imm
4383
4385
// before it's actually used.
4384
4386
cx. llargs . insert ( arg. id , local_mem ( llarg) ) ;
4385
- arg_n += 1u32 ;
4387
+ arg_n += 1 u ;
4386
4388
}
4387
4389
}
4388
4390
@@ -4801,7 +4803,7 @@ fn trans_native_mod(lcx: @local_ctxt, native_mod: ast::native_mod,
4801
4803
let fcx = new_fn_ctxt ( lcx, span, llshimfn) ;
4802
4804
let bcx = new_top_block_ctxt ( fcx) ;
4803
4805
let lltop = bcx. llbb ;
4804
- let llargbundle = llvm:: LLVMGetParam ( llshimfn, 0u32 ) ;
4806
+ let llargbundle = llvm:: LLVMGetParam ( llshimfn, 0 as c_uint ) ;
4805
4807
let i = 0 u, n = vec:: len ( tys. arg_tys ) ;
4806
4808
let llargvals = [ ] ;
4807
4809
while i < n {
@@ -4851,7 +4853,7 @@ fn trans_native_mod(lcx: @local_ctxt, native_mod: ast::native_mod,
4851
4853
store_inbounds ( bcx, llargval, llargbundle, [ 0 , i as int ] ) ;
4852
4854
i += 1 u;
4853
4855
}
4854
- let llretptr = llvm:: LLVMGetParam ( llwrapfn, 0u32 ) ;
4856
+ let llretptr = llvm:: LLVMGetParam ( llwrapfn, 0 as c_uint ) ;
4855
4857
store_inbounds ( bcx, llretptr, llargbundle, [ 0 , n as int ] ) ;
4856
4858
4857
4859
// Create call itself.
@@ -5036,10 +5038,10 @@ fn create_main_wrapper(ccx: @crate_ctxt, sp: span, main_llfn: ValueRef,
5036
5038
let bcx = new_top_block_ctxt ( fcx) ;
5037
5039
let lltop = bcx. llbb ;
5038
5040
5039
- let lloutputarg = llvm:: LLVMGetParam ( llfdecl, 0u32 ) ;
5040
- let llenvarg = llvm:: LLVMGetParam ( llfdecl, 1u32 ) ;
5041
+ let lloutputarg = llvm:: LLVMGetParam ( llfdecl, 0 as c_uint ) ;
5042
+ let llenvarg = llvm:: LLVMGetParam ( llfdecl, 1 as c_uint ) ;
5041
5043
let args = [ lloutputarg, llenvarg] ;
5042
- if takes_argv { args += [ llvm:: LLVMGetParam ( llfdecl, 2u32 ) ] ; }
5044
+ if takes_argv { args += [ llvm:: LLVMGetParam ( llfdecl, 2 as c_uint ) ] ; }
5043
5045
Call ( bcx, main_llfn, args) ;
5044
5046
build_return ( bcx) ;
5045
5047
@@ -5070,8 +5072,8 @@ fn create_main_wrapper(ccx: @crate_ctxt, sp: span, main_llfn: ValueRef,
5070
5072
let start = str:: as_buf ( "rust_start" , { |buf|
5071
5073
llvm:: LLVMAddGlobal ( ccx. llmod , start_ty, buf)
5072
5074
} ) ;
5073
- let args = [ rust_main, llvm:: LLVMGetParam ( llfn, 0u32 ) ,
5074
- llvm:: LLVMGetParam ( llfn, 1u32 ) , crate_map] ;
5075
+ let args = [ rust_main, llvm:: LLVMGetParam ( llfn, 0 as c_uint ) ,
5076
+ llvm:: LLVMGetParam ( llfn, 1 as c_uint ) , crate_map] ;
5075
5077
let result = unsafe {
5076
5078
llvm:: LLVMBuildCall ( bld, start, vec:: to_ptr ( args) ,
5077
5079
vec:: len ( args) as c_uint , noname ( ) )
0 commit comments