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 {
214214 std::optional<bool > Lifetimebound = false ;
215215 std::optional<NullabilityKind> Nullability;
216216 std::optional<RetainCountConventionKind> RetainCountConvention;
217- StringRef Type;
218217 /* TO_UPSTREAM(BoundsSafety) ON */
219- BoundsSafety BoundsSafety;
218+ std::optional< BoundsSafety> BoundsSafety;
220219 /* TO_UPSTREAM(BoundsSafety) OFF */
220+ StringRef Type;
221221};
222222
223223typedef std::vector<Param> ParamsSeq;
@@ -907,9 +907,11 @@ class YAMLConverter {
907907 PI.setRetainCountConvention (P.RetainCountConvention );
908908 BoundsSafetyInfo BSI;
909909 /* 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+ }
913915 PI.BoundsSafety = BSI;
914916 /* TO_UPSTREAM(BoundsSafety) OFF */
915917 if (static_cast <int >(OutInfo.Params .size ()) <= P.Position )
Original file line number Diff line number Diff line change @@ -72,6 +72,12 @@ Functions:
7272 Kind: counted_by
7373 Level: 0
7474 BoundedBy: len
75+ - Name: asdf_counted_default_level
76+ Parameters:
77+ - Position: 0
78+ BoundsSafety:
79+ Kind: counted_by
80+ BoundedBy: len
7581 - Name: asdf_nterm
7682 Parameters:
7783 - Position: 0
Original file line number Diff line number Diff line change @@ -9,5 +9,6 @@ void asdf_counted_out(int ** buf, int * len);
99void asdf_counted_const (int * buf );
1010void asdf_counted_nullable (int len , int * _Nullable buf );
1111void asdf_counted_noescape (int * buf , int len );
12+ void asdf_counted_default_level (int * buf , int len );
1213
1314void asdf_nterm (char * buf );
Original file line number Diff line number Diff line change 3535// CHECK: buf 'int * __counted_by(len)':'int *'
3636// CHECK-NEXT: NoEscapeAttr
3737
38+ // CHECK: asdf_counted_default_level 'void (int * __counted_by(len), int)'
39+ // CHECK: buf 'int * __counted_by(len)':'int *'
40+
3841// CHECK: asdf_nterm 'void (int * __terminated_by(0))'
3942// CHECK: buf 'int * __terminated_by(0)':'int *'
4043
You can’t perform that action at this time.
0 commit comments