verification_pass: show type errors

This commit is contained in:
Tillmann Karras 2016-08-17 13:29:05 +01:00 committed by MerryMage
parent dad7724b86
commit 9782e7da3f
4 changed files with 35 additions and 13 deletions

View file

@ -20,7 +20,10 @@ void VerificationPass(const IR::Block& block) {
for (size_t i = 0; i < inst.NumArgs(); i++) {
IR::Type t1 = inst.GetArg(i).GetType();
IR::Type t2 = IR::GetArgTypeOf(inst.GetOpcode(), i);
ASSERT(t1 == t2 || t1 == IR::Type::Opaque || t2 == IR::Type::Opaque);
if (t1 != t2 && t1 != IR::Type::Opaque && t2 != IR::Type::Opaque) {
puts(IR::DumpBlock(block).c_str());
ASSERT(false);
}
}
}