forked from OSchip/llvm-project
Print both type in diagnostic emitted on mismatch between def/use of SSA Values (NFC)
The error would look like: path/filename.mlir:32:23: error: use of value '%28' expects different type than prior uses: ''i32'' vs ''!_tf.control'' PiperOrigin-RevId: 254874859
This commit is contained in:
parent
c32080a1b0
commit
14a10a818b
|
@ -2638,7 +2638,9 @@ Value *OperationParser::resolveSSAUse(SSAUseInfo useInfo, Type type) {
|
|||
return result;
|
||||
|
||||
emitError(useInfo.loc, "use of value '")
|
||||
.append(useInfo.name, "' expects different type than prior uses")
|
||||
.append(useInfo.name,
|
||||
"' expects different type than prior uses: ", type, " vs ",
|
||||
result->getType())
|
||||
.attachNote(getEncodedSourceLocation(entries[useInfo.number].second))
|
||||
.append("prior use here");
|
||||
return nullptr;
|
||||
|
|
|
@ -366,7 +366,7 @@ func @vectors(vector<1 x vector<1xi32>>, vector<2x4xf32>)
|
|||
func @condbr_notbool() {
|
||||
^bb0:
|
||||
%a = "foo"() : () -> i32 // expected-note {{prior use here}}
|
||||
cond_br %a, ^bb0, ^bb0 // expected-error {{use of value '%a' expects different type than prior uses}}
|
||||
cond_br %a, ^bb0, ^bb0 // expected-error {{use of value '%a' expects different type than prior uses: 'i1' vs 'i32'}}
|
||||
// expected-error@-1 {{expected condition type was boolean (i1)}}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue