mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
The Remarks Streamer's installation seemed a bit overly complex, so simplify it in a few places: * Refactor sil-opt to install the remarks options into the SILOptions for the SILModule This reduces the parameter bloat in createSILRemarkStreamer. All of this data is freely derivable from the SILModule alone. * Refactor createSILRemarkStreamer into SILRemarkStreamer::create With the new reduction in parameters, we can hide the internal constructor and introduce a smart constructor that vends a unique pointer to clients. * setSILRemarkStreamer -> installSILRemarkStreamer Since the information to create a streamer is now entirely derivable from a module, remove a layer of abstraction and have the module directly construct a streamer for itself. * Give SILRemarkStreamer its own LLVMContext The remarks streamer just needs scratch space. It's not actually "installed" in a given context. There no reason to use Swift's Global Context here. * Give the SILRemarkStreamer ownership of the underlying file stream The SILModule didn't actually use this member, and it seems like somebody needs to own it, so just give it to the remarks streamer directly.
86 KiB
86 KiB