Skip to content

Commit 04dfa5b

Browse files
authored
Merge pull request #34783 from gottesmm/pr-247c2c443ee86e229635adc8b92d98372edd8056
[sil] Add a small helper to SILBuilder to get the loc of the builder's current insertion point.
2 parents fe5be63 + f8d0d02 commit 04dfa5b

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

include/swift/SIL/SILBuilder.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -268,8 +268,9 @@ class SILBuilder {
268268
//===--------------------------------------------------------------------===//
269269

270270
bool hasValidInsertionPoint() const { return BB != nullptr; }
271-
SILBasicBlock *getInsertionBB() { return BB; }
272-
SILBasicBlock::iterator getInsertionPoint() { return InsertPt; }
271+
SILBasicBlock *getInsertionBB() const { return BB; }
272+
SILBasicBlock::iterator getInsertionPoint() const { return InsertPt; }
273+
SILLocation getInsertionPointLoc() const { return InsertPt->getLoc(); }
273274

274275
/// insertingAtEndOfBlock - Return true if the insertion point is at the end
275276
/// of the current basic block. False if we're inserting before an existing
@@ -320,8 +321,6 @@ class SILBuilder {
320321
setInsertionPoint(&*BBIter);
321322
}
322323

323-
SILBasicBlock *getInsertionPoint() const { return BB; }
324-
325324
//===--------------------------------------------------------------------===//
326325
// Instruction Tracking
327326
//===--------------------------------------------------------------------===//

0 commit comments

Comments
 (0)