comparison gen/statements.cpp @ 201:8f9191180c7a trunk

[svn r217] Updated: the rebuild profiles. Fixed: way to find class data fields was too strict type wise. Fixed: foreach resulting in an implicit delegate could fail.
author lindquist
date Mon, 12 May 2008 22:44:25 +0200
parents e937752e4541
children 9d44ec83acd1
comparison
equal deleted inserted replaced
200:e937752e4541 201:8f9191180c7a
840 key->ir.irLocal->value = keyvar; 840 key->ir.irLocal->value = keyvar;
841 } 841 }
842 llvm::Value* zerokey = llvm::ConstantInt::get(keytype,0,false); 842 llvm::Value* zerokey = llvm::ConstantInt::get(keytype,0,false);
843 843
844 // value 844 // value
845 Logger::println("value = %s", value->toPrettyChars());
845 const llvm::Type* valtype = DtoType(value->type); 846 const llvm::Type* valtype = DtoType(value->type);
846 llvm::Value* valvar = NULL; 847 llvm::Value* valvar = NULL;
847 if (!value->isRef() && !value->isOut()) 848 if (!value->isRef() && !value->isOut())
848 valvar = new llvm::AllocaInst(valtype, "foreachval", p->topallocapoint()); 849 valvar = new llvm::AllocaInst(valtype, "foreachval", p->topallocapoint());
849 assert(!value->ir.irLocal); 850 if (!value->ir.irLocal)
850 value->ir.irLocal = new IrLocal(value); 851 value->ir.irLocal = new IrLocal(value);
851 852
852 // what to iterate 853 // what to iterate
853 DValue* aggrval = aggr->toElem(p); 854 DValue* aggrval = aggr->toElem(p);
854 Type* aggrtype = DtoDType(aggr->type); 855 Type* aggrtype = DtoDType(aggr->type);
855 856