Don't allocate srclocs if we only have default SourceLoc values.
This avoids needless extra indentation in `write_function` in the case where no SourceLoc information is available.
This commit is contained in:
@@ -132,7 +132,9 @@ impl<'short, 'long, Variable> InstBuilderBase<'short> for FuncInstBuilder<'short
|
|||||||
let inst = self.builder.func.dfg.make_inst(data.clone());
|
let inst = self.builder.func.dfg.make_inst(data.clone());
|
||||||
self.builder.func.dfg.make_inst_results(inst, ctrl_typevar);
|
self.builder.func.dfg.make_inst_results(inst, ctrl_typevar);
|
||||||
self.builder.func.layout.append_inst(inst, self.ebb);
|
self.builder.func.layout.append_inst(inst, self.ebb);
|
||||||
self.builder.func.srclocs[inst] = self.builder.srcloc;
|
if !self.builder.srcloc.is_default() {
|
||||||
|
self.builder.func.srclocs[inst] = self.builder.srcloc;
|
||||||
|
}
|
||||||
|
|
||||||
if data.opcode().is_branch() {
|
if data.opcode().is_branch() {
|
||||||
match data.branch_destination() {
|
match data.branch_destination() {
|
||||||
|
|||||||
Reference in New Issue
Block a user