@@ -320,37 +320,43 @@ fn make_mono_id(ccx: @crate_ctxt, item: ast::def_id, substs: ~[ty::t],
320
320
let param_ids = match param_uses {
321
321
Some ( uses) => {
322
322
vec:: map2 ( precise_param_ids, uses, |id, uses| {
323
- match * id {
324
- ( a, b@Some ( _) ) => mono_precise ( a, b) ,
325
- ( subst, None ) => {
326
- if * uses == 0 u {
327
- mono_any
328
- } else if * uses == type_use:: use_repr &&
329
- !ty:: type_needs_drop ( ccx. tcx , subst)
330
- {
331
- let llty = type_of:: type_of ( ccx, subst) ;
332
- let size = machine:: llbitsize_of_real ( ccx, llty) ;
333
- let align = shape:: llalign_of_pref ( ccx, llty) ;
334
- let mode = datum:: appropriate_mode ( subst) ;
323
+ if ccx. sess . no_monomorphic_collapse ( ) {
324
+ match * id {
325
+ ( a, b) => mono_precise ( a, b)
326
+ }
327
+ } else {
328
+ match * id {
329
+ ( a, b@Some ( _) ) => mono_precise ( a, b) ,
330
+ ( subst, None ) => {
331
+ if * uses == 0 u {
332
+ mono_any
333
+ } else if * uses == type_use:: use_repr &&
334
+ !ty:: type_needs_drop ( ccx. tcx , subst)
335
+ {
336
+ let llty = type_of:: type_of ( ccx, subst) ;
337
+ let size = machine:: llbitsize_of_real ( ccx, llty) ;
338
+ let align = shape:: llalign_of_pref ( ccx, llty) ;
339
+ let mode = datum:: appropriate_mode ( subst) ;
335
340
336
- // FIXME(#3547)---scalars and floats are
337
- // treated differently in most ABIs. But we
338
- // should be doing something more detailed
339
- // here.
340
- let is_float = match ty:: get ( subst) . sty {
341
- ty:: ty_float( _) => true ,
342
- _ => false
343
- } ;
341
+ // FIXME(#3547)---scalars and floats are
342
+ // treated differently in most ABIs. But we
343
+ // should be doing something more detailed
344
+ // here.
345
+ let is_float = match ty:: get ( subst) . sty {
346
+ ty:: ty_float( _) => true ,
347
+ _ => false
348
+ } ;
344
349
345
- // Special value for nil to prevent problems
346
- // with undef return pointers.
347
- if size <= 8 u && ty:: type_is_nil ( subst) {
348
- mono_repr ( 0 u, 0 u, is_float, mode)
350
+ // Special value for nil to prevent problems
351
+ // with undef return pointers.
352
+ if size <= 8 u && ty:: type_is_nil ( subst) {
353
+ mono_repr ( 0 u, 0 u, is_float, mode)
354
+ } else {
355
+ mono_repr ( size, align, is_float, mode)
356
+ }
349
357
} else {
350
- mono_repr ( size , align , is_float , mode )
358
+ mono_precise ( subst , None )
351
359
}
352
- } else {
353
- mono_precise ( subst, None )
354
360
}
355
361
}
356
362
}
0 commit comments