[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:
Manman Ren
2014-07-17 04:43:24 +00:00
parent 61df8d7f1f
commit 1bd9d81971
13 changed files with 73 additions and 38 deletions

View File

@@ -105,6 +105,9 @@ struct PrintOptions {
/// Whether to print accessibility information on all value decls.
bool PrintAccessibility = false;
/// Whether we are printing for sil.
bool PrintForSIL = false;
enum class ArgAndParamPrintingMode {
ArgumentOnly,
BothIfDifferent,