@@ -789,6 +789,16 @@ class SILPrinter : public SILInstructionVisitor<SILPrinter> {
789
789
return true ;
790
790
}
791
791
792
+ void printConformances (ArrayRef<ProtocolConformanceRef> conformances) {
793
+ // FIXME: conformances should always be printed and parsed!
794
+ if (!Ctx.printVerbose ()) {
795
+ return ;
796
+ }
797
+ *this << " // " ;
798
+ for (ProtocolConformanceRef conformance : conformances)
799
+ conformance.dump (PrintState.OS , /* indent*/ 0 , /* details*/ false );
800
+ }
801
+
792
802
void printDebugLocRef (SILLocation Loc, const SourceManager &SM,
793
803
bool PrintComma = true ) {
794
804
auto DL = Loc.decodeDebugLoc (SM);
@@ -1797,6 +1807,7 @@ class SILPrinter : public SILInstructionVisitor<SILPrinter> {
1797
1807
*this << getIDAndType (WMI->getTypeDependentOperands ()[0 ].get ());
1798
1808
}
1799
1809
*this << " : " << WMI->getType ();
1810
+ printConformances ({WMI->getConformance ()});
1800
1811
}
1801
1812
void visitOpenExistentialAddrInst (OpenExistentialAddrInst *OI) {
1802
1813
if (OI->getAccessKind () == OpenedExistentialAccess::Immutable)
@@ -1823,21 +1834,26 @@ class SILPrinter : public SILInstructionVisitor<SILPrinter> {
1823
1834
void visitInitExistentialAddrInst (InitExistentialAddrInst *AEI) {
1824
1835
*this << getIDAndType (AEI->getOperand ()) << " , $"
1825
1836
<< AEI->getFormalConcreteType ();
1837
+ printConformances (AEI->getConformances ());
1826
1838
}
1827
1839
void visitInitExistentialValueInst (InitExistentialValueInst *AEI) {
1828
1840
*this << getIDAndType (AEI->getOperand ()) << " , $"
1829
1841
<< AEI->getFormalConcreteType () << " , " << AEI->getType ();
1842
+ printConformances (AEI->getConformances ());
1830
1843
}
1831
1844
void visitInitExistentialRefInst (InitExistentialRefInst *AEI) {
1832
1845
*this << getIDAndType (AEI->getOperand ()) << " : $"
1833
1846
<< AEI->getFormalConcreteType () << " , " << AEI->getType ();
1847
+ printConformances (AEI->getConformances ());
1834
1848
}
1835
- void visitInitExistentialMetatypeInst (InitExistentialMetatypeInst *AEI) {
1836
- *this << getIDAndType (AEI->getOperand ()) << " , " << AEI->getType ();
1849
+ void visitInitExistentialMetatypeInst (InitExistentialMetatypeInst *EMI) {
1850
+ *this << getIDAndType (EMI->getOperand ()) << " , " << EMI->getType ();
1851
+ printConformances (EMI->getConformances ());
1837
1852
}
1838
1853
void visitAllocExistentialBoxInst (AllocExistentialBoxInst *AEBI) {
1839
1854
*this << AEBI->getExistentialType () << " , $"
1840
1855
<< AEBI->getFormalConcreteType ();
1856
+ printConformances (AEBI->getConformances ());
1841
1857
}
1842
1858
void visitDeinitExistentialAddrInst (DeinitExistentialAddrInst *DEI) {
1843
1859
*this << getIDAndType (DEI->getOperand ());
0 commit comments