Skip to content

Commit f73e6c7

Browse files
committed
Add a SILGenBuilder constructor that takes a new insertion point.
This is the best way to inherit the provided SILGenBuilder's debug scope and context, but insert at a different SIL location.
1 parent f6f9acc commit f73e6c7

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

lib/SILGen/SILGenBuilder.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,14 @@ class SILGenBuilder : public SILBuilder {
6363
SILBasicBlock::iterator insertInst)
6464
: SILGenBuilder(SGF, &*insertBB, insertInst) {}
6565

66+
// Create a new builder, inheriting the given builder's context and debug
67+
// scope.
68+
SILGenBuilder(SILGenBuilder &builder, SILBasicBlock *insertBB)
69+
: SILBuilder(insertBB, builder.getCurrentDebugScope(),
70+
builder.getBuilderContext()),
71+
SGF(builder.SGF)
72+
{}
73+
6674
SILGenModule &getSILGenModule() const;
6775
SILGenFunction &getSILGenFunction() const { return SGF; }
6876

0 commit comments

Comments
 (0)