summaryrefslogtreecommitdiff
path: root/source/slang/slang-ast-support-types.h
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2023-09-07 23:01:53 -0700
committerGitHub <noreply@github.com>2023-09-07 23:01:53 -0700
commitcb5dd19992fb77ca2be866d9c6f2f4436c8b1c1e (patch)
tree4a24573f9da79618c0e65e7462101ab3d0b640c4 /source/slang/slang-ast-support-types.h
parenta7fa215e81e510de34ac96778ac6320cbb642d64 (diff)
Incur l-value conversion cost during overload resolution. (#3195)
* Incur l-value conversion cost during overload resolution. * Fix compile error. * cleanup. --------- Co-authored-by: Yong He <yhe@nvidia.com>
Diffstat (limited to 'source/slang/slang-ast-support-types.h')
-rw-r--r--source/slang/slang-ast-support-types.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/source/slang/slang-ast-support-types.h b/source/slang/slang-ast-support-types.h
index 5d7ca49cb..0b4e9cab2 100644
--- a/source/slang/slang-ast-support-types.h
+++ b/source/slang/slang-ast-support-types.h
@@ -140,6 +140,9 @@ namespace Slang
// the element type of the vector)
kConversionCost_ScalarToVector = 1,
+ // Additional cost when casting an LValue.
+ kConversionCost_LValueCast = 800,
+
// Conversion is impossible
kConversionCost_Impossible = 0xFFFFFFFF,
};
@@ -521,6 +524,13 @@ namespace Slang
QualType(Type* type);
+ QualType(Type* type, bool isLVal)
+ : QualType(type)
+ {
+ isLeftValue = isLVal;
+ }
+
+
Type* Ptr() { return type; }
operator Type*() { return type; }