File tree Expand file tree Collapse file tree 4 files changed +17
-5
lines changed Expand file tree Collapse file tree 4 files changed +17
-5
lines changed Original file line number Diff line number Diff line change @@ -214,10 +214,10 @@ struct Param {
214
214
std::optional<bool > Lifetimebound = false ;
215
215
std::optional<NullabilityKind> Nullability;
216
216
std::optional<RetainCountConventionKind> RetainCountConvention;
217
- StringRef Type;
218
217
/* TO_UPSTREAM(BoundsSafety) ON */
219
- BoundsSafety BoundsSafety;
218
+ std::optional< BoundsSafety> BoundsSafety;
220
219
/* TO_UPSTREAM(BoundsSafety) OFF */
220
+ StringRef Type;
221
221
};
222
222
223
223
typedef std::vector<Param> ParamsSeq;
@@ -907,9 +907,11 @@ class YAMLConverter {
907
907
PI.setRetainCountConvention (P.RetainCountConvention );
908
908
BoundsSafetyInfo BSI;
909
909
/* TO_UPSTREAM(BoundsSafety) ON */
910
- BSI.setKindAudited (P.BoundsSafety .Kind );
911
- BSI.setLevelAudited (P.BoundsSafety .Level );
912
- BSI.ExternalBounds = P.BoundsSafety .BoundsExpr .str ();
910
+ if (P.BoundsSafety ) {
911
+ BSI.setKindAudited (P.BoundsSafety ->Kind );
912
+ BSI.setLevelAudited (P.BoundsSafety ->Level );
913
+ BSI.ExternalBounds = P.BoundsSafety ->BoundsExpr .str ();
914
+ }
913
915
PI.BoundsSafety = BSI;
914
916
/* TO_UPSTREAM(BoundsSafety) OFF */
915
917
if (static_cast <int >(OutInfo.Params .size ()) <= P.Position )
Original file line number Diff line number Diff line change @@ -72,6 +72,12 @@ Functions:
72
72
Kind: counted_by
73
73
Level: 0
74
74
BoundedBy: len
75
+ - Name: asdf_counted_default_level
76
+ Parameters:
77
+ - Position: 0
78
+ BoundsSafety:
79
+ Kind: counted_by
80
+ BoundedBy: len
75
81
- Name: asdf_nterm
76
82
Parameters:
77
83
- Position: 0
Original file line number Diff line number Diff line change @@ -9,5 +9,6 @@ void asdf_counted_out(int ** buf, int * len);
9
9
void asdf_counted_const (int * buf );
10
10
void asdf_counted_nullable (int len , int * _Nullable buf );
11
11
void asdf_counted_noescape (int * buf , int len );
12
+ void asdf_counted_default_level (int * buf , int len );
12
13
13
14
void asdf_nterm (char * buf );
Original file line number Diff line number Diff line change 35
35
// CHECK: buf 'int * __counted_by(len)':'int *'
36
36
// CHECK-NEXT: NoEscapeAttr
37
37
38
+ // CHECK: asdf_counted_default_level 'void (int * __counted_by(len), int)'
39
+ // CHECK: buf 'int * __counted_by(len)':'int *'
40
+
38
41
// CHECK: asdf_nterm 'void (int * __terminated_by(0))'
39
42
// CHECK: buf 'int * __terminated_by(0)':'int *'
40
43
You can’t perform that action at this time.
0 commit comments