comparison gen/toir.cpp @ 1580:b4616536dc04

allow forward referencing, fix #361
author Moritz Warning <moritzwarning@web.de>
date Wed, 09 Sep 2009 20:13:17 +0200
parents 30bdcfb8299e
children 628433c343b4
comparison
equal deleted inserted replaced
1579:819b4f961711 1580:b4616536dc04
987 assert(iexp->e1->op == TOKvar); 987 assert(iexp->e1->op == TOKvar);
988 VarExp* vexp = (VarExp*)iexp->e1; 988 VarExp* vexp = (VarExp*)iexp->e1;
989 VarDeclaration* vd = vexp->var->isVarDeclaration(); 989 VarDeclaration* vd = vexp->var->isVarDeclaration();
990 assert(vd); 990 assert(vd);
991 assert(vd->type->toBasetype()->ty == Tsarray); 991 assert(vd->type->toBasetype()->ty == Tsarray);
992 vd->codegen(Type::sir);
992 assert(vd->ir.irGlobal); 993 assert(vd->ir.irGlobal);
993 994
994 // get index 995 // get index
995 LLConstant* index = iexp->e2->toConstElem(p); 996 LLConstant* index = iexp->e2->toConstElem(p);
996 assert(index->getType() == DtoSize_t()); 997 assert(index->getType() == DtoSize_t());