Description
When outputting NS100 debug info, SpirvEmitter currently skips a lexical scope that coincides with the '(' and ')' of the for loop. This leads to confusing debug info.
Steps to Reproduce
https://godbolt.org/z/Pfe5zcPTb
Actual Behavior
%65 = OpExtInst %void %1 DebugLexicalBlock %42 %uint_11 %uint_1 %62
%66 = OpExtInst %void %1 DebugLexicalBlock %42 %uint_15 %uint_33 %65
Both 'i' variables have the same lexical block.
An examination of LLVM reveals that this can be solved by considering the for-loop controls to be a DebugLexicalScope.
Description
When outputting NS100 debug info, SpirvEmitter currently skips a lexical scope that coincides with the '(' and ')' of the for loop. This leads to confusing debug info.
Steps to Reproduce
https://godbolt.org/z/Pfe5zcPTb
Actual Behavior
%65 = OpExtInst %void %1 DebugLexicalBlock %42 %uint_11 %uint_1 %62
%66 = OpExtInst %void %1 DebugLexicalBlock %42 %uint_15 %uint_33 %65
Both 'i' variables have the same lexical block.
An examination of LLVM reveals that this can be solved by considering the for-loop controls to be a DebugLexicalScope.