@@ -52,6 +52,7 @@ private void SetupTypeMaps(IEnumerable<System.Type> types,
52
52
53
53
public bool FindTypeMap ( Type type , out TypeMap typeMap )
54
54
{
55
+ // Looks up the type in the cache map.
55
56
if ( typeMaps . ContainsKey ( type ) )
56
57
{
57
58
typeMap = typeMaps [ type ] ;
@@ -65,6 +66,7 @@ public bool FindTypeMap(Type type, out TypeMap typeMap)
65
66
if ( specialization != null &&
66
67
FindTypeMap ( specialization , out typeMap ) )
67
68
return true ;
69
+
68
70
if ( template . Template . TemplatedDecl != null )
69
71
{
70
72
if ( FindTypeMap ( template . Template . TemplatedDecl ,
@@ -73,14 +75,17 @@ public bool FindTypeMap(Type type, out TypeMap typeMap)
73
75
typeMap . Type = type ;
74
76
return true ;
75
77
}
78
+
76
79
return false ;
77
80
}
78
81
}
79
82
80
83
Type desugared = type . Desugar ( ) ;
81
84
desugared = ( desugared . GetFinalPointee ( ) ?? desugared ) . Desugar ( ) ;
85
+
82
86
bool printExtra = desugared . IsPrimitiveType ( ) ||
83
87
( desugared . GetFinalPointee ( ) ?? desugared ) . Desugar ( ) . IsPrimitiveType ( ) ;
88
+
84
89
var typePrinter = new CppTypePrinter
85
90
{
86
91
PrintTypeQualifiers = printExtra ,
@@ -89,6 +94,7 @@ public bool FindTypeMap(Type type, out TypeMap typeMap)
89
94
} ;
90
95
91
96
foreach ( var resolveTypeDefs in new [ ] { true , false } )
97
+ {
92
98
foreach ( var typePrintScopeKind in
93
99
new [ ] { TypePrintScopeKind . Local , TypePrintScopeKind . Qualified } )
94
100
{
@@ -101,6 +107,7 @@ public bool FindTypeMap(Type type, out TypeMap typeMap)
101
107
return true ;
102
108
}
103
109
}
110
+ }
104
111
105
112
typeMap = null ;
106
113
var typedef = type as TypedefType ;
0 commit comments