ir/opcodes: Implement IR::AreTypesCompatible

Type-checking is now occuring in more than one place.
This commit is contained in:
MerryMage 2016-08-19 01:34:14 +01:00
parent 9782e7da3f
commit 192a0029be
5 changed files with 10 additions and 3 deletions

View file

@ -20,7 +20,7 @@ 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);
if (t1 != t2 && t1 != IR::Type::Opaque && t2 != IR::Type::Opaque) {
if (!IR::AreTypesCompatible(t1, t2)) {
puts(IR::DumpBlock(block).c_str());
ASSERT(false);
}