From 746c0fa0e8490a6b2f37ee7213dafa5ae46238c7 Mon Sep 17 00:00:00 2001 From: Joshua Warner Date: Sat, 3 May 2014 18:42:40 -0600 Subject: [PATCH] remove ir::Type::Invalid, no longer needed for Subroutine --- include/avian/codegen/ir.h | 4 ---- src/codegen/compiler.cpp | 8 +------- src/compile.cpp | 12 ++---------- 3 files changed, 3 insertions(+), 21 deletions(-) diff --git a/include/avian/codegen/ir.h b/include/avian/codegen/ir.h index a1e4d38001..54ac8e0982 100644 --- a/include/avian/codegen/ir.h +++ b/include/avian/codegen/ir.h @@ -34,10 +34,6 @@ class Type { // Represents the lack of a return value // TODO: remove when possible Void, - - // Represents some arbitrary type that should not be accessed - // TODO: remove when possible - Invalid }; private: diff --git a/src/codegen/compiler.cpp b/src/codegen/compiler.cpp index d1dafc2a0e..45bf92ccc1 100644 --- a/src/codegen/compiler.cpp +++ b/src/codegen/compiler.cpp @@ -1224,7 +1224,6 @@ unsigned typeFootprint(Context* c, ir::Type type) case ir::Type::Object: case ir::Type::Address: case ir::Type::Half: - case ir::Type::Invalid: return 1; case ir::Type::Void: return 0; @@ -2465,12 +2464,7 @@ class MyCompiler: public Compiler { virtual void return_(ir::Type type, ir::Value* a) { - // TODO: once type information is flowed properly, enable this assert. - // Some time later, we can remove the parameter. - assert(&c, - a->type == type - // TODO Temporary hack for Subroutine test!!! - || a->type.flavor() == ir::Type::Invalid); + assert(&c, a->type == type); appendReturn(&c, type.size(), static_cast(a)); } diff --git a/src/compile.cpp b/src/compile.cpp index 3d78c68c24..be33212a80 100644 --- a/src/compile.cpp +++ b/src/compile.cpp @@ -1278,7 +1278,6 @@ ir::Value* loadLocal(Context* context, && (result->type.flavor() == ir::Type::Object || result->type.flavor() == ir::Type::Address)) // TODO Temporary hack for Subroutine test!!! - || result->type.flavor() == ir::Type::Invalid || result->type.flavor() == ir::Type::Integer); return result; } @@ -1295,7 +1294,6 @@ void storeLocal(Context* context, && (value->type.flavor() == ir::Type::Object || value->type.flavor() == ir::Type::Address)) // TODO Temporary hack for Subroutine test!!! - || value->type.flavor() == ir::Type::Invalid || value->type.flavor() == ir::Type::Integer); context->compiler->storeLocal (footprint, value, translateLocalIndex(context, footprint, index)); @@ -1739,10 +1737,7 @@ class Frame { void pushInt(ir::Value* o) { - assert(t, - o->type == types.i4 - // TODO Temporary hack for Subroutine test!!! - || o->type.flavor() == ir::Type::Invalid); + assert(t, o->type == types.i4); pushSmall(o); } @@ -1780,10 +1775,7 @@ class Frame { void pushLong(ir::Value* o) { - assert(t, - o->type == types.i8 - // TODO Temporary hack for Subroutine test!!! - || o->type.flavor() == ir::Type::Invalid); + assert(t, o->type == types.i8); pushLarge(o); }