Misc changes
This commit is contained in:
parent
a29730e288
commit
152bde63fe
2 changed files with 3 additions and 7 deletions
|
@ -261,11 +261,7 @@ fn data_id_for_static(
|
||||||
}
|
}
|
||||||
|
|
||||||
let mut data_ctx = DataContext::new();
|
let mut data_ctx = DataContext::new();
|
||||||
let zero_bytes = std::iter::repeat(0)
|
data_ctx.define_zeroinit(pointer_ty(tcx).bytes() as usize);
|
||||||
.take(pointer_ty(tcx).bytes() as usize)
|
|
||||||
.collect::<Vec<u8>>()
|
|
||||||
.into_boxed_slice();
|
|
||||||
data_ctx.define(zero_bytes);
|
|
||||||
match module.define_data(data_id, &data_ctx) {
|
match module.define_data(data_id, &data_ctx) {
|
||||||
// Everytime a weak static is referenced, there will be a zero pointer definition,
|
// Everytime a weak static is referenced, there will be a zero pointer definition,
|
||||||
// so duplicate definitions are expected and allowed.
|
// so duplicate definitions are expected and allowed.
|
||||||
|
|
|
@ -67,8 +67,8 @@ impl<'tcx> DebugContext<'tcx> {
|
||||||
dwarf.unit.line_program = line_program;
|
dwarf.unit.line_program = line_program;
|
||||||
|
|
||||||
{
|
{
|
||||||
let name = dwarf.strings.add(&*name);
|
let name = dwarf.strings.add(name);
|
||||||
let comp_dir = dwarf.strings.add(&*comp_dir);
|
let comp_dir = dwarf.strings.add(comp_dir);
|
||||||
|
|
||||||
let root = dwarf.unit.root();
|
let root = dwarf.unit.root();
|
||||||
let root = dwarf.unit.get_mut(root);
|
let root = dwarf.unit.get_mut(root);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue