From 0399d992e21128a2c4b676e8f5456981ccfa6469 Mon Sep 17 00:00:00 2001 From: Yong He Date: Wed, 2 May 2018 15:11:04 -0400 Subject: Speedup type checking using cached overload resolution results. This change adds caches to built-in operator overload resolution and type coersion to avoid running these time-consuming operations every time. - Adds `TypeCheckingCache` type, which is defined in check.cpp, that contains two dictionaries for the cached results of `ResolveInvoke` and `CanCoerce` calls. - Add `destroyTypeCheckingCache` and `getTypeCheckingCache` methods to `Session` class to reuse these cached results over the entire session. --- source/slang/syntax.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'source/slang/syntax.h') diff --git a/source/slang/syntax.h b/source/slang/syntax.h index ebb9d814b..00f7eb95b 100644 --- a/source/slang/syntax.h +++ b/source/slang/syntax.h @@ -77,6 +77,9 @@ namespace Slang // a vector (this will be added to the cost, if any, of converting // the element type of the vector) kConversionCost_ScalarToVector = 1, + + // Conversion is impossible + kConversionCost_Impossible = 0xFFFFFFFF, }; // TODO(tfoley): We should ditch this enumeration -- cgit v1.2.3