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

@@ -19,7 +19,7 @@ Value Inst::GetArg(size_t index) const {
void Inst::SetArg(size_t index, Value value) {
DEBUG_ASSERT(index < GetNumArgsOf(op));
DEBUG_ASSERT(value.GetType() == GetArgTypeOf(op, index) || Type::Opaque == GetArgTypeOf(op, index));
DEBUG_ASSERT(AreTypesCompatible(value.GetType(), GetArgTypeOf(op, index)));
if (!args[index].IsImmediate()) {
UndoUse(args[index]);