mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[SILParser] fix a few issues to enable parsing of sil from swift array
Add PrintForSIL in PrintOptions 1> for NameAliasType, we print getSinglyDesugaredType() I attempted another option: set FullyQualifiedTypes of PrintOptions, but that will print xxx.Type.xxx and Parser can’t handle it. 2> for Self, we print @sil_self We also work around parsing: sil_witness_table _CocoaArrayType: _CocoaArrayType sil_vtable uses internal classes in stdlib, so we use lookupTopDecl instead of lookupValue when parsing sil_vtable, to find internal classes. Fix rdar://17261925 rdar://17295316 rdar://17046276 rdar://17579890 Swift SVN r20070
This commit is contained in:
@@ -1837,6 +1837,11 @@ public:
|
||||
}
|
||||
|
||||
void visitNameAliasType(NameAliasType *T) {
|
||||
if (Options.PrintForSIL) {
|
||||
visit(T->getSinglyDesugaredType());
|
||||
return;
|
||||
}
|
||||
|
||||
if (shouldPrintFullyQualified(T)) {
|
||||
if (auto ParentDC = T->getDecl()->getDeclContext()) {
|
||||
printDeclContext(ParentDC);
|
||||
@@ -2195,6 +2200,13 @@ public:
|
||||
}
|
||||
|
||||
void visitArchetypeType(ArchetypeType *T) {
|
||||
if (Options.PrintForSIL) {
|
||||
if (auto proto = T->getSelfProtocol()) {
|
||||
Printer << "@sil_self ";
|
||||
visit(proto->getDeclaredType());
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (auto existentialTy = T->getOpenedExistentialType()) {
|
||||
Printer << "@opened(" << T->getOpenedExistentialID() << ") ";
|
||||
visit(existentialTy);
|
||||
|
||||
Reference in New Issue
Block a user