mirror of
https://gitee.com/openharmony/third_party_spirv-tools
synced 2024-11-27 09:32:08 +00:00
Fix disassembly line for adjacency validations. (#1751)
Previously the adjacency messages would output the last line of the file as the disassembly. This is incorrect, as we have an instruction they can be attached too. This CL fixes the messages to attach to the correct line number.
This commit is contained in:
parent
b7afe4e7ae
commit
dfb53f9f1a
@ -39,7 +39,7 @@ spv_result_t ValidateAdjacency(ValidationState_t& _) {
|
||||
case SpvOpLine:
|
||||
break;
|
||||
default:
|
||||
return _.diag(SPV_ERROR_INVALID_DATA)
|
||||
return _.diag(SPV_ERROR_INVALID_DATA, &(*i))
|
||||
<< "OpPhi must appear before all non-OpPhi instructions "
|
||||
<< "(except for OpLine, which can be mixed with OpPhi).";
|
||||
}
|
||||
@ -52,7 +52,7 @@ spv_result_t ValidateAdjacency(ValidationState_t& _) {
|
||||
case SpvOpBranchConditional:
|
||||
break;
|
||||
default:
|
||||
return _.diag(SPV_ERROR_INVALID_DATA)
|
||||
return _.diag(SPV_ERROR_INVALID_DATA, &(*i))
|
||||
<< "OpLoopMerge must immediately precede either an "
|
||||
<< "OpBranch or OpBranchConditional instruction. "
|
||||
<< "OpLoopMerge must be the second-to-last instruction in "
|
||||
@ -67,7 +67,7 @@ spv_result_t ValidateAdjacency(ValidationState_t& _) {
|
||||
case SpvOpSwitch:
|
||||
break;
|
||||
default:
|
||||
return _.diag(SPV_ERROR_INVALID_DATA)
|
||||
return _.diag(SPV_ERROR_INVALID_DATA, &(*i))
|
||||
<< "OpSelectionMerge must immediately precede either an "
|
||||
<< "OpBranchConditional or OpSwitch instruction. "
|
||||
<< "OpSelectionMerge must be the second-to-last "
|
||||
|
Loading…
Reference in New Issue
Block a user