comparison dmd/FuncDeclaration.d @ 93:df6d0f967680

implemented a whole bunch of methods to make phobos 2.035 compile and some additional ones I came across
author Trass3r
date Mon, 30 Aug 2010 22:50:30 +0200
parents 21a53563c840
children 3a0b150c9841 5c859d5fbe27
comparison
equal deleted inserted replaced
92:0c891ec48515 93:df6d0f967680
15 import dmd.SymOffExp; 15 import dmd.SymOffExp;
16 import dmd.AssignExp; 16 import dmd.AssignExp;
17 import dmd.ExpInitializer; 17 import dmd.ExpInitializer;
18 import dmd.BE; 18 import dmd.BE;
19 import dmd.Id; 19 import dmd.Id;
20 import dmd.StorageClassDeclaration;
20 import dmd.StringExp; 21 import dmd.StringExp;
21 import dmd.DsymbolExp; 22 import dmd.DsymbolExp;
22 import dmd.HaltExp; 23 import dmd.HaltExp;
23 import dmd.CommaExp; 24 import dmd.CommaExp;
24 import dmd.ReturnStatement; 25 import dmd.ReturnStatement;
1648 // called from semantic3 1649 // called from semantic3
1649 void varArgs(Scope sc, TypeFunction, ref VarDeclaration, ref VarDeclaration) 1650 void varArgs(Scope sc, TypeFunction, ref VarDeclaration, ref VarDeclaration)
1650 { 1651 {
1651 assert(false); 1652 assert(false);
1652 } 1653 }
1653 1654
1654 override void toCBuffer(OutBuffer buf, HdrGenState* hgs) 1655 override void toCBuffer(OutBuffer buf, HdrGenState* hgs)
1655 { 1656 {
1656 assert(false); 1657 // writef("FuncDeclaration.toCBuffer() '%s'\n", toChars());
1657 } 1658
1658 1659 StorageClassDeclaration.stcToCBuffer(buf, storage_class);
1659 void bodyToCBuffer(OutBuffer buf, HdrGenState* hgs) 1660 type.toCBuffer(buf, ident, hgs);
1660 { 1661 bodyToCBuffer(buf, hgs);
1661 assert(false); 1662 }
1663
1664 void bodyToCBuffer(OutBuffer buf, HdrGenState* hgs)
1665 {
1666 if (fbody &&
1667 (!hgs.hdrgen || hgs.tpltMember || canInline(1,1))
1668 )
1669 {
1670 buf.writenl();
1671
1672 // in{}
1673 if (frequire)
1674 {
1675 buf.writestring("in");
1676 buf.writenl();
1677 frequire.toCBuffer(buf, hgs);
1678 }
1679
1680 // out{}
1681 if (fensure)
1682 {
1683 buf.writestring("out");
1684 if (outId)
1685 {
1686 buf.writebyte('(');
1687 buf.writestring(outId.toChars());
1688 buf.writebyte(')');
1689 }
1690 buf.writenl();
1691 fensure.toCBuffer(buf, hgs);
1692 }
1693
1694 if (frequire || fensure)
1695 {
1696 buf.writestring("body");
1697 buf.writenl();
1698 }
1699
1700 buf.writebyte('{');
1701 buf.writenl();
1702 fbody.toCBuffer(buf, hgs);
1703 buf.writebyte('}');
1704 buf.writenl();
1705 }
1706 else
1707 { buf.writeByte(';');
1708 buf.writenl();
1709 }
1662 } 1710 }
1663 1711
1664 /**************************************************** 1712 /****************************************************
1665 * Determine if 'this' overrides fd. 1713 * Determine if 'this' overrides fd.
1666 * Return true if it does. 1714 * Return true if it does.