SPIR-V: Return undefined values from implicit returns instead of dummy
Previously if a non-void function implictly returned, a dummy variable was created as return value. Now instead it returns the result of the OpUndef instruction. This better conveys the presence of undefined behavior to SPIR-V consuming tools (and humans). It also saves one ID per occurrence...
This commit is contained in:
@@ -218,6 +218,9 @@ public:
|
||||
// Create a global or function local or IO variable.
|
||||
Id createVariable(StorageClass, Id type, const char* name = 0);
|
||||
|
||||
// Create an imtermediate with an undefined value.
|
||||
Id createUndefined(Id type);
|
||||
|
||||
// Store into an Id and return the l-value
|
||||
void createStore(Id rValue, Id lValue);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user