diff -r 0c3bcd50e361 -r a350c2cc736a jitcraft/SemanticAnalysis.cpp --- a/jitcraft/SemanticAnalysis.cpp Thu Jun 28 01:38:56 2012 -0700 +++ b/jitcraft/SemanticAnalysis.cpp Fri Jun 29 19:35:17 2012 -0700 @@ -17,6 +17,8 @@ */ #include "SemanticAnalysis.h" #include "Types.h" +#include "Zone.h" +#include "TypeManager.h" using namespace jc; @@ -235,7 +237,7 @@ void SemanticAnalysis::visit(VariableDeclaration *node) { - Type *type = Type::NewPrimitive(node->tag()); + Type *type = ZONE()->types()->getPrimitiveForTag(node->tag()); if (!type) return; @@ -267,7 +269,7 @@ } } - type = Type::NewUnsafeArray(type, size); + type = ZONE()->types()->unsafeArray(type, size); } } else { if (node->initialization()) { @@ -282,8 +284,7 @@ void SemanticAnalysis::visit(IntegerLiteral *node) { - Type *type = Type::NewPrimitive(NULL); - node->setType(type); + node->setType(ZONE()->types()->getPrimitive(PrimitiveType_Int32)); } void @@ -335,7 +336,7 @@ // :TODO: test "enum Float { ..." Name *tag = node->name(); - Type *type = Type::NewPrimitive(tag); + Type *type = ZONE()->types()->getPrimitiveForTag(tag); if (!type) return; @@ -361,7 +362,7 @@ void SemanticAnalysis::visit(FloatLiteral *node) { - Type *type = Type::NewPrimitive(PrimitiveType_Float); + Type *type = ZONE()->types()->getPrimitive(PrimitiveType_Float); if (!type) return;