Fix a slang regression with DISABLE_NDEBUG
When generating initializing statements for structs containing rs_matrix,
slang did not properly mark the original declaration as used. This
triggered an assertion failure later in the CodeGen under DISABLE_NDEBUG,
when fed a declaration that:
* is local to a function
* is not used elsewhere
* has an initialization expression
* is of a struct type containing one or more rs_matrix members
For example, consider:
struct M {
rs_matrix3x3 m;
};
void F() {
struct M h = {2.0f};
}
The declaration of struct M h = {2.0f} in F would be transformed into:
struct M h = {};
h = {2.0f}; // this statement was created by slang but h was not marked
// as used.
This CL fixed that by marking the referenced declaration (h in this case)
as used.
Bug: b/37363420
Bug: b/19545955
Test: slang lit tests, slang_test.py, CTS and RSTest on Angler
Change-Id: I8238611e34f8f7f384c0d2e515282485d0d46952
1 file changed