Inline functions from cg_ssa::callee and remove the mod

Fixes #65271
This commit is contained in:
bjorn3 2019-10-13 11:45:34 +02:00
parent f1ed3a8786
commit dad8ddbfdd
6 changed files with 40 additions and 66 deletions

View file

@ -20,7 +20,6 @@ use rustc::ty::layout::{
use rustc::ty::{self, Ty, TyCtxt, Instance};
use rustc::util::nodemap::FxHashMap;
use rustc_target::spec::{HasTargetSpec, Target};
use rustc_codegen_ssa::callee::resolve_and_get_fn;
use rustc_codegen_ssa::base::wants_msvc_seh;
use crate::callee::get_fn;
@ -362,7 +361,14 @@ impl MiscMethods<'tcx> for CodegenCx<'ll, 'tcx> {
let tcx = self.tcx;
let llfn = match tcx.lang_items().eh_personality() {
Some(def_id) if !wants_msvc_seh(self.sess()) => {
resolve_and_get_fn(self, def_id, tcx.intern_substs(&[]))
self.get_fn(
ty::Instance::resolve(
tcx,
ty::ParamEnv::reveal_all(),
def_id,
tcx.intern_substs(&[]),
).unwrap()
)
}
_ => {
let name = if wants_msvc_seh(self.sess()) {
@ -390,7 +396,14 @@ impl MiscMethods<'tcx> for CodegenCx<'ll, 'tcx> {
let tcx = self.tcx;
assert!(self.sess().target.target.options.custom_unwind_resume);
if let Some(def_id) = tcx.lang_items().eh_unwind_resume() {
let llfn = resolve_and_get_fn(self, def_id, tcx.intern_substs(&[]));
let llfn = self.get_fn(
ty::Instance::resolve(
tcx,
ty::ParamEnv::reveal_all(),
def_id,
tcx.intern_substs(&[]),
).unwrap()
);
unwresume.set(Some(llfn));
return llfn;
}