@@ -489,22 +489,6 @@ private extension Instruction {
489489 }
490490 return nil
491491 }
492-
493- /// Returns the next interesting location. As it is impossible to set a
494- /// breakpoint on a meta instruction, those are skipped.
495- /// However, we don't want to take a location with different inlining
496- /// information than this instruction, so in that case, we will return the
497- /// location of the meta instruction. If the meta instruction is the only
498- /// instruction in the basic block, we also take its location.
499- var locationOfNextNonMetaInstruction : Location {
500- let location = self . location
501- guard !location. isInlined,
502- let nextLocation = nextNonMetaInstruction? . location,
503- !nextLocation. isInlined else {
504- return location
505- }
506- return nextLocation
507- }
508492}
509493
510494extension Builder {
@@ -524,7 +508,7 @@ extension Builder {
524508 init ( before insPnt: Instruction , _ context: some MutatingContext ) {
525509 context. verifyIsTransforming ( function: insPnt. parentFunction)
526510 self . init ( insertAt: . before( insPnt) ,
527- location: insPnt. locationOfNextNonMetaInstruction ,
511+ location: insPnt. location ,
528512 context. notifyInstructionChanged, context. _bridged. asNotificationHandler ( ) )
529513 }
530514
@@ -556,7 +540,7 @@ extension Builder {
556540 /// TODO: this is incorrect for terminator instructions. Instead use `Builder.insert(after:location:_:insertFunc)`
557541 /// from OptUtils.swift. Rename this to afterNonTerminator.
558542 init ( after insPnt: Instruction , _ context: some MutatingContext ) {
559- self . init ( after: insPnt, location: insPnt. locationOfNextNonMetaInstruction , context)
543+ self . init ( after: insPnt, location: insPnt. location , context)
560544 }
561545
562546 /// Creates a builder which inserts at the end of `block`, using a custom `location`.
@@ -580,7 +564,7 @@ extension Builder {
580564 context. verifyIsTransforming ( function: block. parentFunction)
581565 let firstInst = block. instructions. first!
582566 self . init ( insertAt: . before( firstInst) ,
583- location: firstInst. locationOfNextNonMetaInstruction ,
567+ location: firstInst. location ,
584568 context. notifyInstructionChanged, context. _bridged. asNotificationHandler ( ) )
585569 }
586570
0 commit comments