mirror of
https://github.com/rust-lang/rust.git
synced 2025-05-14 02:49:40 +00:00
Disable some prinln!'s
This commit is contained in:
parent
7d3f2ba49f
commit
a3760040b2
12
src/abi.rs
12
src/abi.rs
@ -55,12 +55,6 @@ pub fn cton_sig_from_fn_ty<'a, 'tcx: 'a>(
|
|||||||
Abi::Rust => (CallConv::Fast, sig.inputs().to_vec(), sig.output()),
|
Abi::Rust => (CallConv::Fast, sig.inputs().to_vec(), sig.output()),
|
||||||
Abi::C => (CallConv::SystemV, sig.inputs().to_vec(), sig.output()),
|
Abi::C => (CallConv::SystemV, sig.inputs().to_vec(), sig.output()),
|
||||||
Abi::RustCall => {
|
Abi::RustCall => {
|
||||||
println!(
|
|
||||||
"rust-call sig: {:?} inputs: {:?} output: {:?}",
|
|
||||||
sig,
|
|
||||||
sig.inputs(),
|
|
||||||
sig.output()
|
|
||||||
);
|
|
||||||
assert_eq!(sig.inputs().len(), 2);
|
assert_eq!(sig.inputs().len(), 2);
|
||||||
let extra_args = match sig.inputs().last().unwrap().sty {
|
let extra_args = match sig.inputs().last().unwrap().sty {
|
||||||
ty::TyTuple(ref tupled_arguments) => tupled_arguments,
|
ty::TyTuple(ref tupled_arguments) => tupled_arguments,
|
||||||
@ -439,11 +433,6 @@ pub fn codegen_call<'a, 'tcx: 'a>(
|
|||||||
}
|
}
|
||||||
_ => bug!("argument to function with \"rust-call\" ABI is not a tuple"),
|
_ => bug!("argument to function with \"rust-call\" ABI is not a tuple"),
|
||||||
}
|
}
|
||||||
println!(
|
|
||||||
"{:?} {:?}",
|
|
||||||
pack_arg.layout().ty,
|
|
||||||
args.iter().map(|a| a.layout().ty).collect::<Vec<_>>()
|
|
||||||
);
|
|
||||||
args
|
args
|
||||||
} else {
|
} else {
|
||||||
args.into_iter()
|
args.into_iter()
|
||||||
@ -462,7 +451,6 @@ pub fn codegen_call<'a, 'tcx: 'a>(
|
|||||||
let ret_layout = fx.layout_of(sig.output());
|
let ret_layout = fx.layout_of(sig.output());
|
||||||
|
|
||||||
let output_pass_mode = get_pass_mode(fx.tcx, sig.abi, sig.output(), true);
|
let output_pass_mode = get_pass_mode(fx.tcx, sig.abi, sig.output(), true);
|
||||||
println!("{:?}", output_pass_mode);
|
|
||||||
let return_ptr = match output_pass_mode {
|
let return_ptr = match output_pass_mode {
|
||||||
PassMode::NoPass => None,
|
PassMode::NoPass => None,
|
||||||
PassMode::ByRef => match destination {
|
PassMode::ByRef => match destination {
|
||||||
|
@ -771,7 +771,6 @@ pub fn trans_checked_int_binop<'a, 'tcx: 'a>(
|
|||||||
out_place
|
out_place
|
||||||
.place_field(fx, mir::Field::new(0))
|
.place_field(fx, mir::Field::new(0))
|
||||||
.write_cvalue(fx, res);
|
.write_cvalue(fx, res);
|
||||||
println!("abc");
|
|
||||||
out_place
|
out_place
|
||||||
.place_field(fx, mir::Field::new(1))
|
.place_field(fx, mir::Field::new(1))
|
||||||
.write_cvalue(fx, has_overflow);
|
.write_cvalue(fx, has_overflow);
|
||||||
|
@ -23,9 +23,9 @@ impl ConstantCx {
|
|||||||
tcx: TyCtxt<'a, 'tcx, 'tcx>,
|
tcx: TyCtxt<'a, 'tcx, 'tcx>,
|
||||||
module: &mut Module<B>,
|
module: &mut Module<B>,
|
||||||
) {
|
) {
|
||||||
println!("todo {:?}", self.todo);
|
//println!("todo {:?}", self.todo);
|
||||||
define_all_allocs(tcx, module, &mut self);
|
define_all_allocs(tcx, module, &mut self);
|
||||||
println!("done {:?}", self.done);
|
//println!("done {:?}", self.done);
|
||||||
for data_id in self.done.drain() {
|
for data_id in self.done.drain() {
|
||||||
module.finalize_data(data_id);
|
module.finalize_data(data_id);
|
||||||
}
|
}
|
||||||
@ -159,13 +159,13 @@ fn define_all_allocs<'a, 'tcx: 'a, B: Backend + 'a>(
|
|||||||
while let Some(todo_item) = pop_set(&mut cx.todo) {
|
while let Some(todo_item) = pop_set(&mut cx.todo) {
|
||||||
let (data_id, alloc) = match todo_item {
|
let (data_id, alloc) = match todo_item {
|
||||||
TodoItem::Alloc(alloc_id) => {
|
TodoItem::Alloc(alloc_id) => {
|
||||||
println!("alloc_id {}", alloc_id);
|
//println!("alloc_id {}", alloc_id);
|
||||||
let data_id = data_id_for_alloc_id(module, alloc_id);
|
let data_id = data_id_for_alloc_id(module, alloc_id);
|
||||||
let alloc = memory.get(alloc_id).unwrap();
|
let alloc = memory.get(alloc_id).unwrap();
|
||||||
(data_id, alloc)
|
(data_id, alloc)
|
||||||
}
|
}
|
||||||
TodoItem::Static(def_id) => {
|
TodoItem::Static(def_id) => {
|
||||||
println!("static {:?}", def_id);
|
//println!("static {:?}", def_id);
|
||||||
let instance = ty::Instance::mono(tcx, def_id);
|
let instance = ty::Instance::mono(tcx, def_id);
|
||||||
let cid = GlobalId {
|
let cid = GlobalId {
|
||||||
instance,
|
instance,
|
||||||
@ -183,7 +183,7 @@ fn define_all_allocs<'a, 'tcx: 'a, B: Backend + 'a>(
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
println!("data_id {}", data_id);
|
//("data_id {}", data_id);
|
||||||
if cx.done.contains(&data_id) {
|
if cx.done.contains(&data_id) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -36,26 +36,6 @@ impl MetadataLoader for CraneliftMetadataLoader {
|
|||||||
_target: &::rustc_target::spec::Target,
|
_target: &::rustc_target::spec::Target,
|
||||||
_path: &Path,
|
_path: &Path,
|
||||||
) -> Result<owning_ref::ErasedBoxRef<[u8]>, String> {
|
) -> Result<owning_ref::ErasedBoxRef<[u8]>, String> {
|
||||||
//use goblin::Object;
|
|
||||||
|
|
||||||
//let buffer = ::std::fs::read(path).map_err(|e|format!("{:?}", e))?;
|
|
||||||
/*match Object::parse(&buffer).map_err(|e|format!("{:?}", e))? {
|
|
||||||
Object::Elf(elf) => {
|
|
||||||
println!("elf: {:#?}", &elf);
|
|
||||||
},
|
|
||||||
Object::PE(pe) => {
|
|
||||||
println!("pe: {:#?}", &pe);
|
|
||||||
},
|
|
||||||
Object::Mach(mach) => {
|
|
||||||
println!("mach: {:#?}", &mach);
|
|
||||||
},
|
|
||||||
Object::Archive(archive) => {
|
|
||||||
return Err(format!("archive: {:#?}", &archive));
|
|
||||||
},
|
|
||||||
Object::Unknown(magic) => {
|
|
||||||
return Err(format!("unknown magic: {:#x}", magic))
|
|
||||||
}
|
|
||||||
}*/
|
|
||||||
Err("dylib metadata loading is not yet supported".to_string())
|
Err("dylib metadata loading is not yet supported".to_string())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user