Skip to content

Commit df94dff

Browse files
committed
[NFC] Add SILBuilderContext.
In an upcoming bug fix, I want to pass SILBuilderContext to a utility. I could continue reusing SILBuilder, even though the utility must set its own insertion point and debug location. However, this is terrible practice that I don't want to perpetuate. The lifetime of a SILBuilder should correspond to a single insertion point and debug location. That's the only sane way to preserve debug information in SIL passes. There are various pieces of contextual state that we've been adding to the SILBuilder. Those have made it impossible to use SILBuilder correctly. I'm pulling the context out, so clients can begin using better practices. In the future, we can make SILBuilderContext polymorphic, so passes can extend it easily with arbitrary callbacks. We can also make it self-contained so we don't need to pass around pointers to an InsertedInst list anymore.
1 parent 1ffc687 commit df94dff

File tree

2 files changed

+190
-124
lines changed

2 files changed

+190
-124
lines changed

0 commit comments

Comments
 (0)