@@ -489,22 +489,6 @@ private extension Instruction {
489
489
}
490
490
return nil
491
491
}
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
- }
508
492
}
509
493
510
494
extension Builder {
@@ -524,7 +508,7 @@ extension Builder {
524
508
init ( before insPnt: Instruction , _ context: some MutatingContext ) {
525
509
context. verifyIsTransforming ( function: insPnt. parentFunction)
526
510
self . init ( insertAt: . before( insPnt) ,
527
- location: insPnt. locationOfNextNonMetaInstruction ,
511
+ location: insPnt. location ,
528
512
context. notifyInstructionChanged, context. _bridged. asNotificationHandler ( ) )
529
513
}
530
514
@@ -556,7 +540,7 @@ extension Builder {
556
540
/// TODO: this is incorrect for terminator instructions. Instead use `Builder.insert(after:location:_:insertFunc)`
557
541
/// from OptUtils.swift. Rename this to afterNonTerminator.
558
542
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)
560
544
}
561
545
562
546
/// Creates a builder which inserts at the end of `block`, using a custom `location`.
@@ -580,7 +564,7 @@ extension Builder {
580
564
context. verifyIsTransforming ( function: block. parentFunction)
581
565
let firstInst = block. instructions. first!
582
566
self . init ( insertAt: . before( firstInst) ,
583
- location: firstInst. locationOfNextNonMetaInstruction ,
567
+ location: firstInst. location ,
584
568
context. notifyInstructionChanged, context. _bridged. asNotificationHandler ( ) )
585
569
}
586
570
0 commit comments