When inlining, DXC can pass the result of an OpAccessChain as a
parameter. Even if this is not valid SPIR-V, HLSL allows this for the
`this` pointer in member function. Part of legalizing is to inline these
functions.
When this happens, the `var` operand on a debug declare for the parameter
will be replaced by the result of the OpAccessChain. This in invalid.
The debug declare needs the variable with the indexes.
This commit add a pass over each function after inlining that will fix
up the debug declares that are invalid in this way.
Fixes https://github.com/microsoft/DirectXShaderCompiler/issues/5191