perf(lang): Skip ordinary type-use recording
88ab8cc13435e48e64ac92d628bd6990915ff3d50e892b611d324c8baff39b38
Only generic template bodies need symbolic type-use metadata. Avoid the recording call while storing node types for ordinary declarations and expressions.
1 parent
79ddbf6b
lib/std/lang/resolver.rad
+3 -1
| 1932 | 1932 | fn setNodeType(self: *mut Resolver, node: *ast::Node, ty: Type) -> Type { |
|
| 1933 | 1933 | if ty == Type::Unknown { |
|
| 1934 | 1934 | // In this case, we simply don't associate a type. |
|
| 1935 | 1935 | return ty; |
|
| 1936 | 1936 | } |
|
| 1937 | - | recordGenericTypeUse(self, node, ty); |
|
| 1937 | + | if let _ = self.currentGenericTemplate { |
|
| 1938 | + | recordGenericTypeUse(self, node, ty); |
|
| 1939 | + | } |
|
| 1938 | 1940 | set self.nodeData.entries[node.id].ty = ty; |
|
| 1939 | 1941 | ||
| 1940 | 1942 | return ty; |
|
| 1941 | 1943 | } |
|
| 1942 | 1944 |