|
1 | 1 | use rustc::middle::lang_items; |
2 | 2 | use rustc::ty::{self, Ty, TypeFoldable}; |
3 | | -use rustc::ty::layout::{self, LayoutOf, HasTyCtxt}; |
| 3 | +use rustc::ty::layout::{self, LayoutOf, HasTyCtxt, FnTypeExt}; |
4 | 4 | use rustc::mir::{self, Place, PlaceBase, Static, StaticKind}; |
5 | 5 | use rustc::mir::interpret::InterpError; |
6 | 6 | use rustc_target::abi::call::{ArgType, FnType, PassMode, IgnoreMode}; |
@@ -334,14 +334,14 @@ impl<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> { |
334 | 334 | ty::ParamEnv::reveal_all(), |
335 | 335 | &sig, |
336 | 336 | ); |
337 | | - let fn_ty = bx.new_vtable(sig, &[]); |
| 337 | + let fn_ty = FnType::new_vtable(&bx, sig, &[]); |
338 | 338 | let vtable = args[1]; |
339 | 339 | args = &args[..1]; |
340 | 340 | (meth::DESTRUCTOR.get_fn(&mut bx, vtable, &fn_ty), fn_ty) |
341 | 341 | } |
342 | 342 | _ => { |
343 | 343 | (bx.get_fn(drop_fn), |
344 | | - bx.fn_type_of_instance(&drop_fn)) |
| 344 | + FnType::of_instance(&bx, &drop_fn)) |
345 | 345 | } |
346 | 346 | }; |
347 | 347 | helper.do_call(self, &mut bx, fn_ty, drop_fn, args, |
@@ -439,7 +439,7 @@ impl<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> { |
439 | 439 | // Obtain the panic entry point. |
440 | 440 | let def_id = common::langcall(bx.tcx(), Some(span), "", lang_item); |
441 | 441 | let instance = ty::Instance::mono(bx.tcx(), def_id); |
442 | | - let fn_ty = bx.fn_type_of_instance(&instance); |
| 442 | + let fn_ty = FnType::of_instance(&bx, &instance); |
443 | 443 | let llfn = bx.get_fn(instance); |
444 | 444 |
|
445 | 445 | // Codegen the actual panic invoke/call. |
@@ -518,15 +518,15 @@ impl<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> { |
518 | 518 |
|
519 | 519 | let fn_ty = match def { |
520 | 520 | Some(ty::InstanceDef::Virtual(..)) => { |
521 | | - bx.new_vtable(sig, &extra_args) |
| 521 | + FnType::new_vtable(&bx, sig, &extra_args) |
522 | 522 | } |
523 | 523 | Some(ty::InstanceDef::DropGlue(_, None)) => { |
524 | 524 | // Empty drop glue; a no-op. |
525 | 525 | let &(_, target) = destination.as_ref().unwrap(); |
526 | 526 | helper.funclet_br(self, &mut bx, target); |
527 | 527 | return; |
528 | 528 | } |
529 | | - _ => bx.new_fn_type(sig, &extra_args) |
| 529 | + _ => FnType::new(&bx, sig, &extra_args) |
530 | 530 | }; |
531 | 531 |
|
532 | 532 | // Emit a panic or a no-op for `panic_if_uninhabited`. |
@@ -556,7 +556,7 @@ impl<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> { |
556 | 556 | let def_id = |
557 | 557 | common::langcall(bx.tcx(), Some(span), "", lang_items::PanicFnLangItem); |
558 | 558 | let instance = ty::Instance::mono(bx.tcx(), def_id); |
559 | | - let fn_ty = bx.fn_type_of_instance(&instance); |
| 559 | + let fn_ty = FnType::of_instance(&bx, &instance); |
560 | 560 | let llfn = bx.get_fn(instance); |
561 | 561 |
|
562 | 562 | // Codegen the actual panic invoke/call. |
|
0 commit comments