1010//
1111//===----------------------------------------------------------------------===//
1212
13- import SIL
14- import OptimizerBridging
13+ import SILBridging
1514
1615/// Utility for updating SSA for a set of SIL instructions defined in multiple blocks.
17- struct SSAUpdater < Context: MutatingContext > {
16+ public struct SSAUpdater < Context: MutatingContext > {
1817 let context : Context
1918
20- init ( function: Function , type: Type , ownership: Ownership ,
21- _ context: Context ) {
19+ public init ( function: Function , type: Type , ownership: Ownership , _ context: Context ) {
2220 self . context = context
23- context. _bridged. SSAUpdater_initialize ( function. bridged, type. bridged,
24- ownership. _bridged)
21+ context. _bridged. SSAUpdater_initialize ( function. bridged, type. bridged, ownership. _bridged)
2522 }
2623
27- mutating func addAvailableValue( _ value: Value , in block: BasicBlock ) {
24+ public mutating func addAvailableValue( _ value: Value , in block: BasicBlock ) {
2825 context. _bridged. SSAUpdater_addAvailableValue ( block. bridged, value. bridged)
2926 }
3027
3128 /// Construct SSA for a value that is live at the *end* of a basic block.
32- mutating func getValue( atEndOf block: BasicBlock ) -> Value {
29+ public mutating func getValue( atEndOf block: BasicBlock ) -> Value {
3330 context. notifyInstructionsChanged ( )
3431 return context. _bridged. SSAUpdater_getValueAtEndOfBlock ( block. bridged) . value
3532 }
@@ -46,12 +43,12 @@ struct SSAUpdater<Context: MutatingContext> {
4643 /// cond_br bb2, bb3
4744 ///
4845 /// In this case we need to insert a phi argument in bb2, merging %1 and %2.
49- mutating func getValue( inMiddleOf block: BasicBlock ) -> Value {
46+ public mutating func getValue( inMiddleOf block: BasicBlock ) -> Value {
5047 context. notifyInstructionsChanged ( )
5148 return context. _bridged. SSAUpdater_getValueInMiddleOfBlock ( block. bridged) . value
5249 }
5350
54- var insertedPhis : [ Phi ] {
51+ public var insertedPhis : [ Phi ] {
5552 var phis = [ Phi] ( )
5653 let numPhis = context. _bridged. SSAUpdater_getNumInsertedPhis ( )
5754 phis. reserveCapacity ( numPhis)
0 commit comments