Make codegen_naked_asm retrieve the MIR Body itself
This commit is contained in:
parent
1988de5c37
commit
764d3a50a3
2 changed files with 6 additions and 5 deletions
|
|
@ -170,16 +170,16 @@ pub fn codegen_mir<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>(
|
|||
) {
|
||||
assert!(!instance.args.has_infer());
|
||||
|
||||
let mut mir = cx.tcx().instance_mir(instance.def);
|
||||
|
||||
if cx.tcx().codegen_fn_attrs(instance.def_id()).flags.contains(CodegenFnAttrFlags::NAKED) {
|
||||
crate::mir::naked_asm::codegen_naked_asm::<Bx::CodegenCx>(cx, &mir, instance);
|
||||
crate::mir::naked_asm::codegen_naked_asm::<Bx::CodegenCx>(cx, instance);
|
||||
return;
|
||||
}
|
||||
|
||||
let tcx = cx.tcx();
|
||||
let llfn = cx.get_fn(instance);
|
||||
|
||||
let mut mir = tcx.instance_mir(instance.def);
|
||||
|
||||
let fn_abi = cx.fn_abi_of_instance(instance, ty::List::empty());
|
||||
debug!("fn_abi: {:?}", fn_abi);
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ use rustc_abi::{BackendRepr, Float, Integer, Primitive, RegKind};
|
|||
use rustc_attr_parsing::InstructionSetAttr;
|
||||
use rustc_hir::def_id::DefId;
|
||||
use rustc_middle::mir::mono::{Linkage, MonoItem, MonoItemData, Visibility};
|
||||
use rustc_middle::mir::{Body, InlineAsmOperand, START_BLOCK};
|
||||
use rustc_middle::mir::{InlineAsmOperand, START_BLOCK};
|
||||
use rustc_middle::ty::layout::{FnAbiOf, LayoutOf, TyAndLayout};
|
||||
use rustc_middle::ty::{Instance, Ty, TyCtxt};
|
||||
use rustc_middle::{bug, span_bug, ty};
|
||||
|
|
@ -23,9 +23,10 @@ pub(crate) fn codegen_naked_asm<
|
|||
+ MiscCodegenMethods<'tcx>,
|
||||
>(
|
||||
cx: &'a Cx,
|
||||
mir: &Body<'tcx>,
|
||||
instance: Instance<'tcx>,
|
||||
) {
|
||||
let mir = cx.tcx().instance_mir(instance.def);
|
||||
|
||||
let rustc_middle::mir::TerminatorKind::InlineAsm {
|
||||
asm_macro: _,
|
||||
template,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue