diff options
| author | jsmall-nvidia <jsmall@nvidia.com> | 2023-06-30 15:25:59 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-06-30 12:25:59 -0700 |
| commit | c5b0708ead5de2d90ef14f20b5b8e3ed4f576373 (patch) | |
| tree | 0e7691cda679b5f937d7ed73eba021ad9170245c /source/slang/slang-emit.cpp | |
| parent | a3ad4dd77bba6c87abad4f76b72055c9fed94bad (diff) | |
Fix for operator assignment issue (#2951)
* WIP handling LValue coercion via LValueImplicitCast
* Need to have the ptr type for the cast.
* Casting conversion working on C++.
* Make the LValue casts record if in or in/out as we can produce better code if we know the difference.
* WIP LValueCast pass
* Fix tests so we don't fail because downstream compilers detect use of uninitialized variable.
* Do conversions through through tmp for l-value scenarios that can't work other ways.
* Fix a typo.
* Change diagnostic implicit-cast-lvalue for a type that still exhibits the issue.
* Add matrix test.
* Added a bit more clarity around LValue casting choices.
* Small comment improvements.
Improvements based on comments on PR.
* Use findOuterGeneric.
Diffstat (limited to 'source/slang/slang-emit.cpp')
| -rw-r--r-- | source/slang/slang-emit.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/source/slang/slang-emit.cpp b/source/slang/slang-emit.cpp index bd6542e2a..827c69e50 100644 --- a/source/slang/slang-emit.cpp +++ b/source/slang/slang-emit.cpp @@ -35,6 +35,7 @@ #include "slang-ir-lower-result-type.h" #include "slang-ir-lower-optional-type.h" #include "slang-ir-lower-bit-cast.h" +#include "slang-ir-lower-l-value-cast.h" #include "slang-ir-lower-reinterpret.h" #include "slang-ir-loop-unroll.h" #include "slang-ir-metadata.h" @@ -866,6 +867,9 @@ Result linkAndOptimizeIR( legalizeUniformBufferLoad(irModule); } + // Lower all the LValue implict casts (used for out/inout/ref scenarios) + lowerLValueCast(targetRequest, irModule); + // Lower all bit_cast operations on complex types into leaf-level // bit_cast on basic types. lowerBitCast(targetRequest, irModule); |
