Mercurial > projects > ldc
comparison dmd/mtype.c @ 94:61615fa85940 trunk
[svn r98] Added support for std.c.stdlib.alloca via pragma(LLVM_internal, "alloca").
Added support for array .sort and .reverse properties.
Fixed some bugs with pointer arithmetic.
Disabled some DMD AST optimizations that was messing things up, destroying valuable information.
Added a KDevelop project file, this is what I use for coding LLVMDC now :)
Other minor stuff.
author | lindquist |
---|---|
date | Mon, 12 Nov 2007 06:32:46 +0100 |
parents | 70d6113eeb8c |
children | 027b8d8b71ec |
comparison
equal
deleted
inserted
replaced
93:08508eebbb3e | 94:61615fa85940 |
---|---|
1512 char *nm; | 1512 char *nm; |
1513 static char *name[2] = { "_adReverseChar", "_adReverseWchar" }; | 1513 static char *name[2] = { "_adReverseChar", "_adReverseWchar" }; |
1514 | 1514 |
1515 nm = name[n->ty == Twchar]; | 1515 nm = name[n->ty == Twchar]; |
1516 fd = FuncDeclaration::genCfunc(Type::tindex, nm); | 1516 fd = FuncDeclaration::genCfunc(Type::tindex, nm); |
1517 fd->llvmRunTimeHack = true; | |
1517 ec = new VarExp(0, fd); | 1518 ec = new VarExp(0, fd); |
1518 e = e->castTo(sc, n->arrayOf()); // convert to dynamic array | 1519 e = e->castTo(sc, n->arrayOf()); // convert to dynamic array |
1519 arguments = new Expressions(); | 1520 arguments = new Expressions(); |
1520 arguments->push(e); | 1521 arguments->push(e); |
1521 e = new CallExp(e->loc, ec, arguments); | 1522 e = new CallExp(e->loc, ec, arguments); |
1529 char *nm; | 1530 char *nm; |
1530 static char *name[2] = { "_adSortChar", "_adSortWchar" }; | 1531 static char *name[2] = { "_adSortChar", "_adSortWchar" }; |
1531 | 1532 |
1532 nm = name[n->ty == Twchar]; | 1533 nm = name[n->ty == Twchar]; |
1533 fd = FuncDeclaration::genCfunc(Type::tindex, nm); | 1534 fd = FuncDeclaration::genCfunc(Type::tindex, nm); |
1535 fd->llvmRunTimeHack = true; | |
1534 ec = new VarExp(0, fd); | 1536 ec = new VarExp(0, fd); |
1535 e = e->castTo(sc, n->arrayOf()); // convert to dynamic array | 1537 e = e->castTo(sc, n->arrayOf()); // convert to dynamic array |
1536 arguments = new Expressions(); | 1538 arguments = new Expressions(); |
1537 arguments->push(e); | 1539 arguments->push(e); |
1538 e = new CallExp(e->loc, ec, arguments); | 1540 e = new CallExp(e->loc, ec, arguments); |
1566 FuncDeclaration *fd; | 1568 FuncDeclaration *fd; |
1567 Expressions *arguments; | 1569 Expressions *arguments; |
1568 | 1570 |
1569 fd = FuncDeclaration::genCfunc(tint32->arrayOf(), | 1571 fd = FuncDeclaration::genCfunc(tint32->arrayOf(), |
1570 (char*)(n->ty == Tbit ? "_adSortBit" : "_adSort")); | 1572 (char*)(n->ty == Tbit ? "_adSortBit" : "_adSort")); |
1573 fd->llvmRunTimeHack = true; | |
1571 ec = new VarExp(0, fd); | 1574 ec = new VarExp(0, fd); |
1572 e = e->castTo(sc, n->arrayOf()); // convert to dynamic array | 1575 e = e->castTo(sc, n->arrayOf()); // convert to dynamic array |
1573 arguments = new Expressions(); | 1576 arguments = new Expressions(); |
1574 arguments->push(e); | 1577 arguments->push(e); |
1575 if (next->ty != Tbit) | 1578 if (next->ty != Tbit) |