@@ -52,6 +52,7 @@ private void SetupTypeMaps(IEnumerable<System.Type> types,
5252
5353 public bool FindTypeMap ( Type type , out TypeMap typeMap )
5454 {
55+ // Looks up the type in the cache map.
5556 if ( typeMaps . ContainsKey ( type ) )
5657 {
5758 typeMap = typeMaps [ type ] ;
@@ -65,6 +66,7 @@ public bool FindTypeMap(Type type, out TypeMap typeMap)
6566 if ( specialization != null &&
6667 FindTypeMap ( specialization , out typeMap ) )
6768 return true ;
69+
6870 if ( template . Template . TemplatedDecl != null )
6971 {
7072 if ( FindTypeMap ( template . Template . TemplatedDecl ,
@@ -73,14 +75,17 @@ public bool FindTypeMap(Type type, out TypeMap typeMap)
7375 typeMap . Type = type ;
7476 return true ;
7577 }
78+
7679 return false ;
7780 }
7881 }
7982
8083 Type desugared = type . Desugar ( ) ;
8184 desugared = ( desugared . GetFinalPointee ( ) ?? desugared ) . Desugar ( ) ;
85+
8286 bool printExtra = desugared . IsPrimitiveType ( ) ||
8387 ( desugared . GetFinalPointee ( ) ?? desugared ) . Desugar ( ) . IsPrimitiveType ( ) ;
88+
8489 var typePrinter = new CppTypePrinter
8590 {
8691 PrintTypeQualifiers = printExtra ,
@@ -89,6 +94,7 @@ public bool FindTypeMap(Type type, out TypeMap typeMap)
8994 } ;
9095
9196 foreach ( var resolveTypeDefs in new [ ] { true , false } )
97+ {
9298 foreach ( var typePrintScopeKind in
9399 new [ ] { TypePrintScopeKind . Local , TypePrintScopeKind . Qualified } )
94100 {
@@ -101,6 +107,7 @@ public bool FindTypeMap(Type type, out TypeMap typeMap)
101107 return true ;
102108 }
103109 }
110+ }
104111
105112 typeMap = null ;
106113 var typedef = type as TypedefType ;
0 commit comments