summaryrefslogtreecommitdiffstats
path: root/source/slang/syntax.h
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2018-05-02 15:11:04 -0400
committerYong He <yonghe@outlook.com>2018-05-02 18:20:32 -0400
commit0399d992e21128a2c4b676e8f5456981ccfa6469 (patch)
tree8ca5c144c438d95406eba5b41be3a3e689beb36a /source/slang/syntax.h
parent60bcc6809f57e12f3705cc65cb325b0983b08899 (diff)
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.
Diffstat (limited to 'source/slang/syntax.h')
-rw-r--r--source/slang/syntax.h3
1 files changed, 3 insertions, 0 deletions
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