Add source location support to FuncCursor and EncCursor.
A cursor now also remembers a current source location which will be assigned to all new instructions created with the cursor. The old layout::Cursor can't support source locations because it doesn't have a reference to the full ir::Function.
This commit is contained in:
@@ -51,6 +51,7 @@ fn deref_addr(inst: ir::Inst, func: &mut ir::Function, base: ir::GlobalVar, offs
|
||||
// detects any cycles in the `deref` globals.
|
||||
let ptr_ty = func.dfg.value_type(func.dfg.first_result(inst));
|
||||
let mut pos = FuncCursor::new(func).at_inst(inst);
|
||||
pos.use_srcloc(inst);
|
||||
|
||||
let base_addr = pos.ins().global_addr(ptr_ty, base);
|
||||
// TODO: We could probably set both `notrap` and `aligned` on this load instruction.
|
||||
|
||||
Reference in New Issue
Block a user