<feed xmlns='http://www.w3.org/2005/Atom'>
<title>slang.git/tools/slang-unit-test/unit-test-decl-tree-reflection.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-04-26T19:04:01+00:00</updated>
<entry>
<title>Added getCanonicalGenericConstraints2 (sorts constraints and allows more generic expressions) (#6787)</title>
<updated>2025-04-26T19:04:01+00:00</updated>
<author>
<name>Ronan</name>
<email>ro.cailleau@gmail.com</email>
</author>
<published>2025-04-26T19:04:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=a5efbb1b775afb2f6b29b37d39947c41744bb005'/>
<id>urn:sha1:a5efbb1b775afb2f6b29b37d39947c41744bb005</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Feature/initialize list side branch (#6058)</title>
<updated>2025-02-05T18:37:03+00:00</updated>
<author>
<name>kaizhangNV</name>
<email>149626564+kaizhangNV@users.noreply.github.com</email>
</author>
<published>2025-02-05T18:37:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=9ec6b91686b651d959fd9ffbec283845bd725dd6'/>
<id>urn:sha1:9ec6b91686b651d959fd9ffbec283845bd725dd6</id>
<content type='text'>
* SP004: implement initialize list translation to ctor

- We synthesize a member-wise constructor for each struct follow
   the rules described in SP004.
- Add logic to translate the initialize list to constructor invoke
- Add cuda-host decoration for the synthesized constructor
- Remove the default constructor when we have a valid member init constructor
- Disable -zero-initialize option, will re-implement it in followup (#6109).
- Fix the overload lookup issue
    When creating invoke expression for ctor, we need to call
    ResolveInvoke() to find us the best candidates, however
    the existing lookup logic could find us the base constructor
    for child struct, we should eliminate this case by providing
    the LookupOptions::IgnoreInheritance to lookup, this requires
    us to create a subcontext on SemanticsVisitor to indicate that
    we only want to use this option on looking the constructor.
- Do not implicit initialize a struct that doesn't have explicit default
   constructor.

Co-authored-by: slangbot &lt;186143334+slangbot@users.noreply.github.com&gt;</content>
</entry>
<entry>
<title>Fix attribute reflection. (#5823)</title>
<updated>2024-12-11T21:34:54+00:00</updated>
<author>
<name>Yong He</name>
<email>yonghe@outlook.com</email>
</author>
<published>2024-12-11T21:34:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=941f07040a505f1f673c96da959bde839c629aba'/>
<id>urn:sha1:941f07040a505f1f673c96da959bde839c629aba</id>
<content type='text'>
* Fix attribute reflection.

* Fix.

* Fix.</content>
</entry>
<entry>
<title>Change how DeclRef::toText works (#5592)</title>
<updated>2024-11-21T01:51:59+00:00</updated>
<author>
<name>Sai Praveen Bangaru</name>
<email>31557731+saipraveenb25@users.noreply.github.com</email>
</author>
<published>2024-11-21T01:51:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=e9caf5de9c0ae137c31c32ea27bc17d7735689a3'/>
<id>urn:sha1:e9caf5de9c0ae137c31c32ea27bc17d7735689a3</id>
<content type='text'>
* Change how DeclRef::toText works

We now ignore the decl-ref heirarchy since that only includes nodes with specialization info &amp; simply walk up the tree of decls, while emitting any specializations present in the decl-ref.

* Update some tests. Add cases for direct refs to generic params &amp; Lookup decl refs</content>
</entry>
<entry>
<title>Correct include dir for libslang (#5539)</title>
<updated>2024-11-14T04:34:18+00:00</updated>
<author>
<name>Ellie Hermaszewska</name>
<email>ellieh@nvidia.com</email>
</author>
<published>2024-11-14T04:34:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=7b570feed42976a6e787d79a70aaf8e667745e58'/>
<id>urn:sha1:7b570feed42976a6e787d79a70aaf8e667745e58</id>
<content type='text'>
This stops adding the repo root to the include path for anything linking
with slang. This enabled a bunch of convenient includes, but might lead
to confusing behavior for anyone including slang. Not to mention
differences including it from an install vs source.

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>Add API method to specialize function reference with argument types (#4966)</title>
<updated>2024-09-16T20:04:45+00:00</updated>
<author>
<name>Sai Praveen Bangaru</name>
<email>31557731+saipraveenb25@users.noreply.github.com</email>
</author>
<published>2024-09-16T20:04:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=d866c0b9dfc0fdc8ad8cede4d7a8593f7ddf4716'/>
<id>urn:sha1:d866c0b9dfc0fdc8ad8cede4d7a8593f7ddf4716</id>
<content type='text'>
* Add `FunctionReflection::specializeWithArgTypes()`

* Update slang.cpp

* Use a shared semantics context on linkage

Improve performance on reflection queries

* Try to fix linux/mac compile errors</content>
</entry>
<entry>
<title>Add ability to specialize generic references to functions, types and more (#4909)</title>
<updated>2024-08-27T20:47:05+00:00</updated>
<author>
<name>Sai Praveen Bangaru</name>
<email>31557731+saipraveenb25@users.noreply.github.com</email>
</author>
<published>2024-08-27T20:47:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=4aac22da6ae902eca1e7750f4e5b83ba238b5874'/>
<id>urn:sha1:4aac22da6ae902eca1e7750f4e5b83ba238b5874</id>
<content type='text'>
* More reflection API features.

+ Lookup methods and members (by string) on types
+ Fix issue with looking up non-static members through the scope operator '::'
+ `GenericReflection`: Cast a decl to generic to access unspecialized generic parameter names and constraints
+ `GenericReflection`: Use `getGenericContainer()` from function, variable or type to access the 'nearest' generic parent along with specialization info
+ `GenericReflection::getConcreteType` and `GenericReflection::getConcreteIntVal`: to get the concrete type of a param in the context of the reflection object
+ `GenericReflection::getOuterGenericContainer` to go up one level and get the outer generic declarations (if there are more than one enclosing generic scopes)
+ `DeclReflection::getParent`: go to parent declaration.
+ Change `VariableReflection` to be a `DeclRef` rather than a decl (allows us to return properly substituted types for methods, members, and more)

* Fix Falcor issue

* Initial namespace reflection support

* FIx issue with specializing witness tables

* Add API method for specializing parameters of a generic decl

* Add ability to specialize generic references to functions, types and more

This PR adds the following end-points:

- `specializeGeneric()` method that can be called on a generic reflection to substitute arguments for generic type and value parameters. It returns another generic reflection, but this time with the appropriate substitution.
- `applySpecializations()` method to then copy these specializations onto an existing type or function reflection.
- `isSubType()` to check if a type is a subtype of another type (useful to check if a type is differentiable by checking `IDifferentiable`)

This PR also:
 - Adds `DeclReflection::Kind::Namespace` so that namespace containers are correctly reflected when walking the decl-tree. the name can be obtained through `getName()` but there's no need to cast to a namespace (since there's nothing else we can do with a namespace decl)
 - Fixes an issue with name-based lookups that fail if a type or function is referenced without specializations. Its helpful to be able to form a reference to a function with default substitutions, so that we can we can specialize it later (either directly, or via argument types).

* Update slang.h

* Fix up naming

* Update slang-compiler.h

* Update slang-reflection-api.cpp

* Update slang.cpp

* Update slang.cpp

* Update slang.cpp

* Use `checkGenericAppWithCheckedArgs` to do specialization

* Update slang-reflection-api.cpp

* Update slang-check-decl.cpp</content>
</entry>
<entry>
<title>More reflection API features. (#4740)</title>
<updated>2024-08-07T06:04:37+00:00</updated>
<author>
<name>Sai Praveen Bangaru</name>
<email>31557731+saipraveenb25@users.noreply.github.com</email>
</author>
<published>2024-08-07T06:04:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=2f2ae8c31490ab01ce0d0cc76d5d7fcf1d21efe7'/>
<id>urn:sha1:2f2ae8c31490ab01ce0d0cc76d5d7fcf1d21efe7</id>
<content type='text'>
* More reflection API features.

+ Lookup methods and members (by string) on types
+ Fix issue with looking up non-static members through the scope operator '::'
+ `GenericReflection`: Cast a decl to generic to access unspecialized generic parameter names and constraints
+ `GenericReflection`: Use `getGenericContainer()` from function, variable or type to access the 'nearest' generic parent along with specialization info
+ `GenericReflection::getConcreteType` and `GenericReflection::getConcreteIntVal`: to get the concrete type of a param in the context of the reflection object
+ `GenericReflection::getOuterGenericContainer` to go up one level and get the outer generic declarations (if there are more than one enclosing generic scopes)
+ `DeclReflection::getParent`: go to parent declaration.
+ Change `VariableReflection` to be a `DeclRef` rather than a decl (allows us to return properly substituted types for methods, members, and more)

* Fix Falcor issue</content>
</entry>
<entry>
<title>Initial implementation for decl-tree reflection API (#4666)</title>
<updated>2024-07-18T17:11:19+00:00</updated>
<author>
<name>Sai Praveen Bangaru</name>
<email>31557731+saipraveenb25@users.noreply.github.com</email>
</author>
<published>2024-07-18T17:11:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=0d06ebcefb36a19710d87832fc1ea027e21281af'/>
<id>urn:sha1:0d06ebcefb36a19710d87832fc1ea027e21281af</id>
<content type='text'>
* Initial implementation for decl-tree reflection API

This patch adds Slang API methods for walking all the declarations in the AST.

We expose this functionality through an abstract `DeclReflection` class that can be a type, function or a variable declaration.
We also provide ways to cast the decl to a `FunctionReflection`, `TypeReflection` or `VariableReflection` and traverse through the child nodes (for instance, a struct type will have component variable declarations)

This patch also adds `ISlangInternal` as an internal COM interface to allow us to cast IGlobalSession to the internal Session pointer while bypassing any wrappers (such as the capture interface)

* Update slang.h

* Remove `ISlangInternal` (its causing a diamond pattern w.r.t `ISlangUnknown`) and use `ComPtr` for proper ref management.

* Update unit-test-decl-tree-reflection.cpp

* Change `FunctionDeclBase` to use `DeclRef` instead of directly using the decl.

* Update slang-reflection-api.cpp</content>
</entry>
</feed>
