File tree Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -2773,10 +2773,18 @@ bool SILParser::parseSpecificSILInstruction(SILBuilder &B,
2773
2773
case SILInstructionKind::AllocBoxInst: {
2774
2774
bool hasDynamicLifetime = false ;
2775
2775
bool hasReflection = false ;
2776
- if (parseSILOptional (hasDynamicLifetime, *this , " dynamic_lifetime" ))
2777
- return true ;
2778
- if (parseSILOptional (hasReflection, *this , " reflection" ))
2779
- return true ;
2776
+ StringRef attrName;
2777
+ SourceLoc attrLoc;
2778
+ while (parseSILOptional (attrName, attrLoc, *this )) {
2779
+ if (attrName.equals (" dynamic_lifetime" )) {
2780
+ hasDynamicLifetime = true ;
2781
+ } else if (attrName.equals (" reflection" )) {
2782
+ hasReflection = true ;
2783
+ } else {
2784
+ P.diagnose (attrLoc, diag::sil_invalid_attribute_for_expected, attrName,
2785
+ " dynamic_lifetime or reflection" );
2786
+ }
2787
+ }
2780
2788
2781
2789
SILType Ty;
2782
2790
if (parseSILType (Ty))
You can’t perform that action at this time.
0 commit comments