Misc changes

This commit is contained in:
bjorn3 2020-03-07 11:27:49 +01:00
parent a29730e288
commit 152bde63fe
2 changed files with 3 additions and 7 deletions

View File

@ -261,11 +261,7 @@ fn data_id_for_static(
}
let mut data_ctx = DataContext::new();
let zero_bytes = std::iter::repeat(0)
.take(pointer_ty(tcx).bytes() as usize)
.collect::<Vec<u8>>()
.into_boxed_slice();
data_ctx.define(zero_bytes);
data_ctx.define_zeroinit(pointer_ty(tcx).bytes() as usize);
match module.define_data(data_id, &data_ctx) {
// Everytime a weak static is referenced, there will be a zero pointer definition,
// so duplicate definitions are expected and allowed.

View File

@ -67,8 +67,8 @@ impl<'tcx> DebugContext<'tcx> {
dwarf.unit.line_program = line_program;
{
let name = dwarf.strings.add(&*name);
let comp_dir = dwarf.strings.add(&*comp_dir);
let name = dwarf.strings.add(name);
let comp_dir = dwarf.strings.add(comp_dir);
let root = dwarf.unit.root();
let root = dwarf.unit.get_mut(root);