@@ -1793,6 +1793,10 @@ struct SILDebugVariable {
17931793 Implicit == V.Implicit && Type == V.Type && Loc == V.Loc &&
17941794 Scope == V.Scope ;
17951795 }
1796+
1797+ bool isLet () const { return Name.size () && Constant; }
1798+
1799+ bool isVar () const { return Name.size () && !Constant; }
17961800};
17971801
17981802// / A DebugVariable where storage for the strings has been
@@ -2004,7 +2008,20 @@ class AllocStackInst final
20042008 auto VI = TailAllocatedDebugVariable (RawValue);
20052009 return VI.get (getDecl (), getTrailingObjects<char >(), AuxVarType, VarDeclLoc,
20062010 VarDeclScope, DIExprElements);
2007- };
2011+ }
2012+
2013+ bool isLet () const {
2014+ if (auto varInfo = getVarInfo ())
2015+ return varInfo->isLet ();
2016+ return false ;
2017+ }
2018+
2019+ bool isVar () const {
2020+ if (auto varInfo = getVarInfo ())
2021+ return varInfo->isVar ();
2022+ return false ;
2023+ }
2024+
20082025 void setArgNo (unsigned N) {
20092026 auto RawValue = SILNode::Bits.AllocStackInst .VarInfo ;
20102027 auto VI = TailAllocatedDebugVariable (RawValue);
@@ -7424,6 +7441,35 @@ class MoveValueInst
74247441 void setAllowsDiagnostics (bool newValue) { allowDiagnostics = newValue; }
74257442};
74267443
7444+ // / Equivalent to a copy_addr to [init] except that it is used for diagnostics
7445+ // / and should not be pattern matched. During the diagnostic passes, the "move
7446+ // / function" checker for addresses always converts this to a copy_addr [init]
7447+ // / (if we emitted a diagnostic and proved we could not emit a move here) or a
7448+ // / copy_addr [take][init] if we can. So this should never occur in canonical
7449+ // / SIL.
7450+ class MarkUnresolvedMoveAddrInst
7451+ : public InstructionBase<SILInstructionKind::MarkUnresolvedMoveAddrInst,
7452+ NonValueInstruction>,
7453+ public CopyLikeInstruction {
7454+ friend class SILBuilder ;
7455+
7456+ FixedOperandList<2 > Operands;
7457+
7458+ MarkUnresolvedMoveAddrInst (SILDebugLocation DebugLoc, SILValue srcAddr,
7459+ SILValue takeAddr)
7460+ : InstructionBase(DebugLoc), Operands(this , srcAddr, takeAddr) {}
7461+
7462+ public:
7463+ SILValue getSrc () const { return Operands[Src].get (); }
7464+ SILValue getDest () const { return Operands[Dest].get (); }
7465+
7466+ void setSrc (SILValue V) { Operands[Src].set (V); }
7467+ void setDest (SILValue V) { Operands[Dest].set (V); }
7468+
7469+ ArrayRef<Operand> getAllOperands () const { return Operands.asArray (); }
7470+ MutableArrayRef<Operand> getAllOperands () { return Operands.asArray (); }
7471+ };
7472+
74277473// / Given an object reference, return true iff it is non-nil and refers
74287474// / to a native swift object with strong reference count of 1.
74297475class IsUniqueInst
0 commit comments