diff options
| author | jsmall-nvidia <jsmall@nvidia.com> | 2023-07-05 13:23:14 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-07-05 13:23:14 -0400 |
| commit | 69450a2be7575aa4f984b9ae2824da0e5634c9f0 (patch) | |
| tree | d554404f441af7fd113737cae8e1bde4897a814e /source/slang/slang-emit.cpp | |
| parent | f9b73eab7edcedc9dc2c7825fcd4171631d14ac7 (diff) | |
Initial sizeof/alignof implementation. (#2954)
* Initial sizeof implementation.
* Small macro improvement.
* Fix some typos.
* Refactor NaturalSize.
Add more sizeof tests.
* Use _makeParseExpr to add sizeof support.
* Add size-of.slang diagnostic result.
* Fix typo in folding with macro change.
* Add a sizeof test of This.
* Some more NaturalSize coverage.
* Simple alignof support.
* Testing for alignof.
* Added 8 bit enum to check enums values are correctly sized.
* Add alignof to completion.
* Lower sizeof/alignof to IR.
sizeof/alignof IR pass.
Tests for simple generic scenarios.
* Make append handle invalid properly.
Improve comments.
---------
Co-authored-by: Theresa Foley <10618364+tangent-vector@users.noreply.github.com>
Diffstat (limited to 'source/slang/slang-emit.cpp')
| -rw-r--r-- | source/slang/slang-emit.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/source/slang/slang-emit.cpp b/source/slang/slang-emit.cpp index 827c69e50..4c050ffcc 100644 --- a/source/slang/slang-emit.cpp +++ b/source/slang/slang-emit.cpp @@ -36,6 +36,7 @@ #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-size-of.h" #include "slang-ir-lower-reinterpret.h" #include "slang-ir-loop-unroll.h" #include "slang-ir-metadata.h" @@ -867,6 +868,10 @@ Result linkAndOptimizeIR( legalizeUniformBufferLoad(irModule); } + // Lower sizeof/alignof + + lowerSizeOfLike(targetRequest, irModule, sink); + // Lower all the LValue implict casts (used for out/inout/ref scenarios) lowerLValueCast(targetRequest, irModule); |
