@@ -875,6 +875,36 @@ public struct Compiler_Protobuf_ThrowStatement: @unchecked Sendable {
875
875
fileprivate var _storage = _StorageClass. defaultInstance
876
876
}
877
877
878
+ public struct Compiler_Protobuf_WithStatement : @unchecked Sendable {
879
+ // SwiftProtobuf.Message conformance is added in an extension below. See the
880
+ // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
881
+ // methods supported on all messages.
882
+
883
+ public var object : Compiler_Protobuf_Expression {
884
+ get { return _storage. _object ?? Compiler_Protobuf_Expression ( ) }
885
+ set { _uniqueStorage ( ) . _object = newValue}
886
+ }
887
+ /// Returns true if `object` has been explicitly set.
888
+ public var hasObject : Bool { return _storage. _object != nil }
889
+ /// Clears the value of `object`. Subsequent reads from it will return its default value.
890
+ public mutating func clearObject( ) { _uniqueStorage ( ) . _object = nil }
891
+
892
+ public var body : Compiler_Protobuf_Statement {
893
+ get { return _storage. _body ?? Compiler_Protobuf_Statement ( ) }
894
+ set { _uniqueStorage ( ) . _body = newValue}
895
+ }
896
+ /// Returns true if `body` has been explicitly set.
897
+ public var hasBody : Bool { return _storage. _body != nil }
898
+ /// Clears the value of `body`. Subsequent reads from it will return its default value.
899
+ public mutating func clearBody( ) { _uniqueStorage ( ) . _body = nil }
900
+
901
+ public var unknownFields = SwiftProtobuf . UnknownStorage ( )
902
+
903
+ public init ( ) { }
904
+
905
+ fileprivate var _storage = _StorageClass. defaultInstance
906
+ }
907
+
878
908
public struct Compiler_Protobuf_Statement : @unchecked Sendable {
879
909
// SwiftProtobuf.Message conformance is added in an extension below. See the
880
910
// `Message` and `Message+*Additions` files in the SwiftProtobuf library for
@@ -1021,6 +1051,14 @@ public struct Compiler_Protobuf_Statement: @unchecked Sendable {
1021
1051
set { _uniqueStorage ( ) . _statement = . throwStatement( newValue) }
1022
1052
}
1023
1053
1054
+ public var withStatement : Compiler_Protobuf_WithStatement {
1055
+ get {
1056
+ if case . withStatement( let v) ? = _storage. _statement { return v}
1057
+ return Compiler_Protobuf_WithStatement ( )
1058
+ }
1059
+ set { _uniqueStorage ( ) . _statement = . withStatement( newValue) }
1060
+ }
1061
+
1024
1062
public var unknownFields = SwiftProtobuf . UnknownStorage ( )
1025
1063
1026
1064
public enum OneOf_Statement : Equatable , Sendable {
@@ -1041,6 +1079,7 @@ public struct Compiler_Protobuf_Statement: @unchecked Sendable {
1041
1079
case continueStatement( Compiler_Protobuf_ContinueStatement )
1042
1080
case tryStatement( Compiler_Protobuf_TryStatement )
1043
1081
case throwStatement( Compiler_Protobuf_ThrowStatement )
1082
+ case withStatement( Compiler_Protobuf_WithStatement )
1044
1083
1045
1084
}
1046
1085
@@ -3896,6 +3935,90 @@ extension Compiler_Protobuf_ThrowStatement: SwiftProtobuf.Message, SwiftProtobuf
3896
3935
}
3897
3936
}
3898
3937
3938
+ extension Compiler_Protobuf_WithStatement : SwiftProtobuf . Message , SwiftProtobuf . _MessageImplementationBase , SwiftProtobuf . _ProtoNameProviding {
3939
+ public static let protoMessageName : String = _protobuf_package + " .WithStatement "
3940
+ public static let _protobuf_nameMap : SwiftProtobuf . _NameMap = [
3941
+ 1 : . same( proto: " object " ) ,
3942
+ 2 : . same( proto: " body " ) ,
3943
+ ]
3944
+
3945
+ fileprivate class _StorageClass {
3946
+ var _object : Compiler_Protobuf_Expression ? = nil
3947
+ var _body : Compiler_Protobuf_Statement ? = nil
3948
+
3949
+ #if swift(>=5.10)
3950
+ // This property is used as the initial default value for new instances of the type.
3951
+ // The type itself is protecting the reference to its storage via CoW semantics.
3952
+ // This will force a copy to be made of this reference when the first mutation occurs;
3953
+ // hence, it is safe to mark this as `nonisolated(unsafe)`.
3954
+ static nonisolated ( unsafe) let defaultInstance = _StorageClass ( )
3955
+ #else
3956
+ static let defaultInstance = _StorageClass ( )
3957
+ #endif
3958
+
3959
+ private init ( ) { }
3960
+
3961
+ init ( copying source: _StorageClass ) {
3962
+ _object = source. _object
3963
+ _body = source. _body
3964
+ }
3965
+ }
3966
+
3967
+ fileprivate mutating func _uniqueStorage( ) -> _StorageClass {
3968
+ if !isKnownUniquelyReferenced( & _storage) {
3969
+ _storage = _StorageClass ( copying: _storage)
3970
+ }
3971
+ return _storage
3972
+ }
3973
+
3974
+ public mutating func decodeMessage< D: SwiftProtobuf . Decoder > ( decoder: inout D ) throws {
3975
+ _ = _uniqueStorage ( )
3976
+ try withExtendedLifetime ( _storage) { ( _storage: _StorageClass ) in
3977
+ while let fieldNumber = try decoder. nextFieldNumber ( ) {
3978
+ // The use of inline closures is to circumvent an issue where the compiler
3979
+ // allocates stack space for every case branch when no optimizations are
3980
+ // enabled. https://github.com/apple/swift-protobuf/issues/1034
3981
+ switch fieldNumber {
3982
+ case 1 : try { try decoder. decodeSingularMessageField ( value: & _storage. _object) } ( )
3983
+ case 2 : try { try decoder. decodeSingularMessageField ( value: & _storage. _body) } ( )
3984
+ default : break
3985
+ }
3986
+ }
3987
+ }
3988
+ }
3989
+
3990
+ public func traverse< V: SwiftProtobuf . Visitor > ( visitor: inout V ) throws {
3991
+ try withExtendedLifetime ( _storage) { ( _storage: _StorageClass ) in
3992
+ // The use of inline closures is to circumvent an issue where the compiler
3993
+ // allocates stack space for every if/case branch local when no optimizations
3994
+ // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
3995
+ // https://github.com/apple/swift-protobuf/issues/1182
3996
+ try { if let v = _storage. _object {
3997
+ try visitor. visitSingularMessageField ( value: v, fieldNumber: 1 )
3998
+ } } ( )
3999
+ try { if let v = _storage. _body {
4000
+ try visitor. visitSingularMessageField ( value: v, fieldNumber: 2 )
4001
+ } } ( )
4002
+ }
4003
+ try unknownFields. traverse ( visitor: & visitor)
4004
+ }
4005
+
4006
+ public static func == ( lhs: Compiler_Protobuf_WithStatement , rhs: Compiler_Protobuf_WithStatement ) -> Bool {
4007
+ if lhs. _storage !== rhs. _storage {
4008
+ let storagesAreEqual : Bool = withExtendedLifetime ( ( lhs. _storage, rhs. _storage) ) { ( _args: ( _StorageClass , _StorageClass ) ) in
4009
+ let _storage = _args. 0
4010
+ let rhs_storage = _args. 1
4011
+ if _storage. _object != rhs_storage. _object { return false }
4012
+ if _storage. _body != rhs_storage. _body { return false }
4013
+ return true
4014
+ }
4015
+ if !storagesAreEqual { return false }
4016
+ }
4017
+ if lhs. unknownFields != rhs. unknownFields { return false }
4018
+ return true
4019
+ }
4020
+ }
4021
+
3899
4022
extension Compiler_Protobuf_Statement : SwiftProtobuf . Message , SwiftProtobuf . _MessageImplementationBase , SwiftProtobuf . _ProtoNameProviding {
3900
4023
public static let protoMessageName : String = _protobuf_package + " .Statement "
3901
4024
public static let _protobuf_nameMap : SwiftProtobuf . _NameMap = [
@@ -3916,6 +4039,7 @@ extension Compiler_Protobuf_Statement: SwiftProtobuf.Message, SwiftProtobuf._Mes
3916
4039
15 : . same( proto: " continueStatement " ) ,
3917
4040
16 : . same( proto: " tryStatement " ) ,
3918
4041
17 : . same( proto: " throwStatement " ) ,
4042
+ 18 : . same( proto: " withStatement " ) ,
3919
4043
]
3920
4044
3921
4045
fileprivate class _StorageClass {
@@ -4174,6 +4298,19 @@ extension Compiler_Protobuf_Statement: SwiftProtobuf.Message, SwiftProtobuf._Mes
4174
4298
_storage. _statement = . throwStatement( v)
4175
4299
}
4176
4300
} ( )
4301
+ case 18 : try {
4302
+ var v : Compiler_Protobuf_WithStatement ?
4303
+ var hadOneofValue = false
4304
+ if let current = _storage. _statement {
4305
+ hadOneofValue = true
4306
+ if case . withStatement( let m) = current { v = m}
4307
+ }
4308
+ try decoder. decodeSingularMessageField ( value: & v)
4309
+ if let v = v {
4310
+ if hadOneofValue { try decoder. handleConflictingOneOf ( ) }
4311
+ _storage. _statement = . withStatement( v)
4312
+ }
4313
+ } ( )
4177
4314
default : break
4178
4315
}
4179
4316
}
@@ -4255,6 +4392,10 @@ extension Compiler_Protobuf_Statement: SwiftProtobuf.Message, SwiftProtobuf._Mes
4255
4392
guard case . throwStatement( let v) ? = _storage. _statement else { preconditionFailure ( ) }
4256
4393
try visitor. visitSingularMessageField ( value: v, fieldNumber: 17 )
4257
4394
} ( )
4395
+ case . withStatement? : try {
4396
+ guard case . withStatement( let v) ? = _storage. _statement else { preconditionFailure ( ) }
4397
+ try visitor. visitSingularMessageField ( value: v, fieldNumber: 18 )
4398
+ } ( )
4258
4399
case nil : break
4259
4400
}
4260
4401
}
0 commit comments