comparison dmd/statement.c @ 86:fd32135dca3e trunk

[svn r90] Major updates to the gen directory. Redesigned the 'elem' struct. Much more... !!! Lots of bugfixes. Added support for special foreach on strings. Added std.array, std.utf, std.ctype and std.uni to phobos. Changed all the .c files in the gen dir to .cpp (it *is* C++ after all)
author lindquist
date Sat, 03 Nov 2007 14:44:58 +0100
parents 77cdca8c210f
children 70d6113eeb8c
comparison
equal deleted inserted replaced
85:f869c636a113 86:fd32135dca3e
1436 */ 1436 */
1437 if (dim == 2) 1437 if (dim == 2)
1438 fdapply = FuncDeclaration::genCfunc(Type::tindex, "_aaApply2"); 1438 fdapply = FuncDeclaration::genCfunc(Type::tindex, "_aaApply2");
1439 else 1439 else
1440 fdapply = FuncDeclaration::genCfunc(Type::tindex, "_aaApply"); 1440 fdapply = FuncDeclaration::genCfunc(Type::tindex, "_aaApply");
1441 fdapply->llvmRunTimeHack = true;
1441 ec = new VarExp(0, fdapply); 1442 ec = new VarExp(0, fdapply);
1442 Expressions *exps = new Expressions(); 1443 Expressions *exps = new Expressions();
1443 exps->push(aggr); 1444 exps->push(aggr);
1444 size_t keysize = taa->key->size(); 1445 size_t keysize = taa->key->size();
1445 keysize = (keysize + 3) & ~3; 1446 keysize = (keysize + 3) & ~3;
1477 } 1478 }
1478 const char *r = (op == TOKforeach_reverse) ? "R" : ""; 1479 const char *r = (op == TOKforeach_reverse) ? "R" : "";
1479 int j = sprintf(fdname, "_aApply%s%.*s%d", r, 2, fntab[flag], dim); 1480 int j = sprintf(fdname, "_aApply%s%.*s%d", r, 2, fntab[flag], dim);
1480 assert(j < sizeof(fdname)); 1481 assert(j < sizeof(fdname));
1481 fdapply = FuncDeclaration::genCfunc(Type::tindex, fdname); 1482 fdapply = FuncDeclaration::genCfunc(Type::tindex, fdname);
1483 fdapply->llvmRunTimeHack = true;
1482 1484
1483 ec = new VarExp(0, fdapply); 1485 ec = new VarExp(0, fdapply);
1484 Expressions *exps = new Expressions(); 1486 Expressions *exps = new Expressions();
1485 if (tab->ty == Tsarray) 1487 if (tab->ty == Tsarray)
1486 aggr = aggr->castTo(sc, tn->arrayOf()); 1488 aggr = aggr->castTo(sc, tn->arrayOf());