diff options
| author | Yong He <yonghe@outlook.com> | 2023-09-07 23:01:53 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-09-07 23:01:53 -0700 |
| commit | cb5dd19992fb77ca2be866d9c6f2f4436c8b1c1e (patch) | |
| tree | 4a24573f9da79618c0e65e7462101ab3d0b640c4 /source/slang/slang-ast-support-types.h | |
| parent | a7fa215e81e510de34ac96778ac6320cbb642d64 (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.h | 10 |
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; } |
