@@ -3846,6 +3846,7 @@ bool SILParser::parseSpecificSILInstruction(SILBuilder &B,
38463846 bool allowsDiagnostics = false ;
38473847 bool isLexical = false ;
38483848 bool hasPointerEscape = false ;
3849+ bool fromVarDecl = false ;
38493850
38503851 StringRef AttrName;
38513852 SourceLoc AttrLoc;
@@ -3856,6 +3857,8 @@ bool SILParser::parseSpecificSILInstruction(SILBuilder &B,
38563857 isLexical = true ;
38573858 else if (AttrName == " pointer_escape" )
38583859 hasPointerEscape = true ;
3860+ else if (AttrName == " var_decl" )
3861+ fromVarDecl = true ;
38593862 else {
38603863 P.diagnose (InstLoc.getSourceLoc (),
38613864 diag::sil_invalid_attribute_for_instruction, AttrName,
@@ -3868,7 +3871,8 @@ bool SILParser::parseSpecificSILInstruction(SILBuilder &B,
38683871 return true ;
38693872 if (parseSILDebugLocation (InstLoc, B))
38703873 return true ;
3871- auto *MVI = B.createMoveValue (InstLoc, Val, isLexical, hasPointerEscape);
3874+ auto *MVI = B.createMoveValue (InstLoc, Val, isLexical, hasPointerEscape,
3875+ fromVarDecl);
38723876 MVI->setAllowsDiagnostics (allowsDiagnostics);
38733877 ResultVal = MVI;
38743878 break ;
@@ -4077,6 +4081,7 @@ bool SILParser::parseSpecificSILInstruction(SILBuilder &B,
40774081
40784082 bool isLexical = false ;
40794083 bool hasPointerEscape = false ;
4084+ bool fromVarDecl = false ;
40804085
40814086 StringRef AttrName;
40824087 SourceLoc AttrLoc;
@@ -4085,6 +4090,8 @@ bool SILParser::parseSpecificSILInstruction(SILBuilder &B,
40854090 isLexical = true ;
40864091 else if (AttrName == " pointer_escape" )
40874092 hasPointerEscape = true ;
4093+ else if (AttrName == " var_decl" )
4094+ fromVarDecl = true ;
40884095 else {
40894096 P.diagnose (InstLoc.getSourceLoc (),
40904097 diag::sil_invalid_attribute_for_instruction, AttrName,
@@ -4097,7 +4104,8 @@ bool SILParser::parseSpecificSILInstruction(SILBuilder &B,
40974104 parseSILDebugLocation (InstLoc, B))
40984105 return true ;
40994106
4100- ResultVal = B.createBeginBorrow (InstLoc, Val, isLexical, hasPointerEscape);
4107+ ResultVal = B.createBeginBorrow (InstLoc, Val, isLexical, hasPointerEscape,
4108+ fromVarDecl);
41014109 break ;
41024110 }
41034111
0 commit comments