File tree Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -51,8 +51,20 @@ class SILBuilder {
51
51
// / only by SILGen or SIL deserializers.
52
52
SILOpenedArchetypesTracker *OpenedArchetypesTracker = nullptr ;
53
53
54
+ // / True if this SILBuilder is being used for parsing.
55
+ // /
56
+ // / This is important since in such a case, we want to not perform any
57
+ // / Ownership Verification in SILBuilder. This functionality is very useful
58
+ // / for determining if qualified or unqualified instructions are being created
59
+ // / in appropriate places, but prevents us from inferring ownership
60
+ // / qualification of functions when parsing. The ability to perform this
61
+ // / inference is important since otherwise, we would need to update all SIL
62
+ // / test cases while bringing up SIL ownership.
63
+ bool isParsing = false ;
64
+
54
65
public:
55
- SILBuilder (SILFunction &F) : F(F), BB(0 ) {}
66
+ SILBuilder (SILFunction &F, bool isParsing = false )
67
+ : F(F), BB(0 ), isParsing(isParsing) {}
56
68
57
69
SILBuilder (SILFunction &F, SmallVectorImpl<SILInstruction *> *InsertedInstrs)
58
70
: F(F), BB(0 ), InsertedInstrs(InsertedInstrs) {}
Original file line number Diff line number Diff line change @@ -4103,7 +4103,7 @@ bool Parser::parseDeclSIL() {
4103
4103
// Parse the basic block list.
4104
4104
FunctionState.OwnershipEvaluator .reset (FunctionState.F );
4105
4105
SILOpenedArchetypesTracker OpenedArchetypesTracker (*FunctionState.F );
4106
- SILBuilder B (*FunctionState.F );
4106
+ SILBuilder B (*FunctionState.F , /* isParsing */ true );
4107
4107
// Track the archetypes just like SILGen. This
4108
4108
// is required for adding typedef operands to instructions.
4109
4109
B.setOpenedArchetypesTracker (&OpenedArchetypesTracker);
You can’t perform that action at this time.
0 commit comments