<feed xmlns='http://www.w3.org/2005/Atom'>
<title>slang.git/source/slang/slang-ir-lower-error-handling.cpp, branch master</title>
<subtitle>Making it easier to work with shaders</subtitle>
<id>https://git.yummers.dev/slang.git/atom?h=master</id>
<link rel='self' href='https://git.yummers.dev/slang.git/atom?h=master'/>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/'/>
<updated>2025-05-23T19:27:37+00:00</updated>
<entry>
<title>Implement throw &amp; catch statements (#6916)</title>
<updated>2025-05-23T19:27:37+00:00</updated>
<author>
<name>Julius Ikkala</name>
<email>julius.ikkala@gmail.com</email>
</author>
<published>2025-05-23T19:27:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=57c3f938221c427b78da7087f8a832ba4a271a7c'/>
<id>urn:sha1:57c3f938221c427b78da7087f8a832ba4a271a7c</id>
<content type='text'>
* Implement throw statement

It already existed in the IR, so only parsing, checking and lowering was
missing.

* Initial catch implementation

Likely very broken.

* Error out when catch() isn't last in scope

* Prevent accessing variables from scope preceding catch

As those may actually not be available at that point.

* Add IError and use it in Result type lowering

* Add diagnostic tests

* Allow caught throws in non-throw functions

* Fix catch propagating between functions &amp; SPIR-V merge issue

* Add test for non-trivial error types

* Fix MSVC build

* Fix invalid value type from Result lowering

* Also lower error handling in templates

* Lower result types only after specialization

* Attempt to disambiguate error enums by witness table

* Revert matching by witness, types should be distinct too

* Don't assert valueField when getting Result's error value

It may not exist if the function returns void, but getting the error
value is still legitimate.

* Update tests for new error numbers &amp; get rid of expected.txt

* Change catch lowering to resemble breaking a loop

... To make SPIR-V happy.

* Fix dead catch blocks and invalid cached dominator tree

* More SPIR-V adjustment

* Lower catch as two nested loops

* Add defer interaction test and revert broken defer changes

* Fix enum type when throwing literals

* Cleanup and bikeshedding

* Document error handling mechanism

* Fix table of contents

* Use boolean tag in Result&lt;T, E&gt;

* Use anyValue storage for Result&lt;T,E&gt;

* Remove IError

* Fix formatting

* Eradicate success values from docs and tests

* Use parseModernParamDecl for catch parameter

* Implement do-catch syntax

* Implement catch-all

* Fix formatting

* Fix marshalling native calls that throw

---------

Co-authored-by: Yong He &lt;yonghe@outlook.com&gt;</content>
</entry>
<entry>
<title>Move switch statement bodies to their own lines (#5493)</title>
<updated>2024-11-05T17:47:26+00:00</updated>
<author>
<name>Ellie Hermaszewska</name>
<email>ellieh@nvidia.com</email>
</author>
<published>2024-11-05T17:47:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=b118451e301d734e3e783b3acdf871f3f6ea851c'/>
<id>urn:sha1:b118451e301d734e3e783b3acdf871f3f6ea851c</id>
<content type='text'>
* Move switch statement bodies to their own lines

* format

---------

Co-authored-by: Yong He &lt;yonghe@outlook.com&gt;</content>
</entry>
<entry>
<title>format</title>
<updated>2024-10-29T06:49:26+00:00</updated>
<author>
<name>Ellie Hermaszewska</name>
<email>ellieh@nvidia.com</email>
</author>
<published>2024-10-29T06:49:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=f65d756bff8d4c5cbc15bd0322a2ae8e6b896a21'/>
<id>urn:sha1:f65d756bff8d4c5cbc15bd0322a2ae8e6b896a21</id>
<content type='text'>
* format

* Minor test fixes

* enable checking cpp format in ci</content>
</entry>
<entry>
<title>Pool inst worklists and hashsets to avoid rehashing. (#2982)</title>
<updated>2023-07-13T02:55:41+00:00</updated>
<author>
<name>Yong He</name>
<email>yonghe@outlook.com</email>
</author>
<published>2023-07-13T02:55:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=f3aba255f6d69ddbf255b33d0eb0f391908e60a8'/>
<id>urn:sha1:f3aba255f6d69ddbf255b33d0eb0f391908e60a8</id>
<content type='text'>
Co-authored-by: Yong He &lt;yhe@nvidia.com&gt;</content>
</entry>
<entry>
<title>Dictionary using lowerCamel (#2835)</title>
<updated>2023-04-25T14:43:29+00:00</updated>
<author>
<name>jsmall-nvidia</name>
<email>jsmall@nvidia.com</email>
</author>
<published>2023-04-25T14:43:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=7b7c095b37e85ca3a8f55eff1c3d9643d467b8e0'/>
<id>urn:sha1:7b7c095b37e85ca3a8f55eff1c3d9643d467b8e0</id>
<content type='text'>
* #include an absolute path didn't work - because paths were taken to always be relative.

* WIP lowerCamel Dictionary.

* WIP more lowerCamel fixes for Dictionary.

* Add/Remove/Clear

* GetValue/Contains

* Fix tabs in dictionary.
Count -&gt; getCount

* Fix fields with caps.

* Key -&gt; key
Value -&gt; value
Use m_ for members where appropriate.
Use lowerCamel in linked list.

* Some small fixes/improvements to Dictionary.

* Kick CI.</content>
</entry>
<entry>
<title>Remove `SharedIRBuilder`. (#2657)</title>
<updated>2023-02-17T00:44:04+00:00</updated>
<author>
<name>Yong He</name>
<email>yonghe@outlook.com</email>
</author>
<published>2023-02-17T00:44:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=245466d89cfe54b78da486f06d470bc6daaf4625'/>
<id>urn:sha1:245466d89cfe54b78da486f06d470bc6daaf4625</id>
<content type='text'>
Co-authored-by: Yong He &lt;yhe@nvidia.com&gt;</content>
</entry>
<entry>
<title>Data flow validation pass for diagnosing derivative loss. (#2523)</title>
<updated>2022-11-18T20:37:27+00:00</updated>
<author>
<name>Yong He</name>
<email>yonghe@outlook.com</email>
</author>
<published>2022-11-18T20:37:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=d58e08f8237a1888ceaad53402d534679ea83b1a'/>
<id>urn:sha1:d58e08f8237a1888ceaad53402d534679ea83b1a</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Clean up void returns. (#2260)</title>
<updated>2022-06-02T05:29:10+00:00</updated>
<author>
<name>Yong He</name>
<email>yonghe@outlook.com</email>
</author>
<published>2022-06-02T05:29:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=bc6bc56db51d06b92dc63ef9c9e0def6c9760c9e'/>
<id>urn:sha1:bc6bc56db51d06b92dc63ef9c9e0def6c9760c9e</id>
<content type='text'>
* Clean up `IRReturnVoid`.

* Update gitignore.

Co-authored-by: Yong He &lt;yhe@nvidia.com&gt;</content>
</entry>
<entry>
<title>New language feature: basic error handling. (#2253)</title>
<updated>2022-06-02T00:37:07+00:00</updated>
<author>
<name>Yong He</name>
<email>yonghe@outlook.com</email>
</author>
<published>2022-06-02T00:37:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=17e3b88b541ed7f45d575f0f9caaa808cd0a6619'/>
<id>urn:sha1:17e3b88b541ed7f45d575f0f9caaa808cd0a6619</id>
<content type='text'>
* New language feature: basic error handling.

* Fix.

* Fix `tryCall` encoding according to code review.

Co-authored-by: Yong He &lt;yhe@nvidia.com&gt;</content>
</entry>
</feed>
