Fixed subtle issue that causes tests to fail in VS2013 in some configs.
authorAndrew Woloszyn <awoloszyn@google.com>
Fri, 18 Sep 2015 20:12:03 +0000 (16:12 -0400)
committerAndrew Woloszyn <awoloszyn@google.com>
Fri, 18 Sep 2015 20:12:03 +0000 (16:12 -0400)
commit2d83ab2f57013e9b0281fb6859a74c8bd3b006d4
tree7fb70e1fb447cad4b2f27b8aea9817544ba23566
parentb9cd3996c7a67687b0a1fe5066c92e43a820de1e
Fixed subtle issue that causes tests to fail in VS2013 in some configs.

Depending on specific optimization settings VS2013 will sometimes
execute the operands to

new Instruction(builder.getUniqueId(), builder.makeBoolType(), OpPhi)

left-to-right, and sometimes right-to-left. Since makeBoolType can
also call getUniqueId(), the IDs to the OpPhi can sometimes be swapped.

This guarantees an explicit ordering of the Ids so that tests work
reliably.
SPIRV/SpvBuilder.cpp
SPIRV/SpvBuilder.h