Changeset 600
- Timestamp:
- 08/05/10 18:16:27 (14 years ago)
- Files:
-
- branches/dmd-1.x/src/e2ir.c (modified) (1 diff)
- trunk/src/e2ir.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/dmd-1.x/src/e2ir.c
r579 r600 1680 1680 e = e1->toElem(irs); 1681 1681 einc = e2->toElem(irs); 1682 1682 e = el_bin((op == TOKplusplus) ? OPpostinc : OPpostdec, 1683 1683 e->Ety,e,einc); 1684 1684 el_setLoc(e,loc); 1685 1685 return e; 1686 1686 } 1687 1687 1688 1688 //////////////////////////// Binary /////////////////////////////// 1689 1689 1690 1690 /******************************************** 1691 1691 */ 1692 1692 1693 1693 elem *BinExp::toElemBin(IRState *irs,int op) 1694 1694 { 1695 1695 //printf("toElemBin() '%s'\n", toChars()); 1696 1696 1697 1697 Type *tb1 = e1->type->toBasetype(); 1698 1698 Type *tb2 = e2->type->toBasetype(); 1699 1699 1700 if ((tb1->ty == Tarray || tb1->ty == Tsarray) && 1701 (tb2->ty == Tarray || tb2->ty == Tsarray) && 1700 if ((tb1->ty == Tarray || tb1->ty == Tsarray || 1701 tb2->ty == Tarray || tb2->ty == Tsarray) && 1702 tb2->ty != Tvoid && 1702 1703 op != OPeq && op != OPandand && op != OPoror 1703 1704 ) 1704 1705 { 1705 1706 error("Array operation %s not implemented", toChars()); 1706 1707 return el_long(type->totym(), 0); // error recovery 1707 1708 } 1708 1709 1709 1710 tym_t tym = type->totym(); 1710 1711 1711 1712 elem *el = e1->toElem(irs); 1712 1713 elem *er = e2->toElem(irs); 1713 1714 elem *e = el_bin(op,tym,el,er); 1714 1715 1715 1716 el_setLoc(e,loc); 1716 1717 return e; 1717 1718 } 1718 1719 1719 1720 /*************************************** 1720 1721 */ 1721 1722 trunk/src/e2ir.c
r579 r600 1984 1984 elem *e = e1->toElem(irs); 1985 1985 elem *einc = e2->toElem(irs); 1986 1986 e = el_bin((op == TOKplusplus) ? OPpostinc : OPpostdec, 1987 1987 e->Ety,e,einc); 1988 1988 el_setLoc(e,loc); 1989 1989 return e; 1990 1990 } 1991 1991 1992 1992 //////////////////////////// Binary /////////////////////////////// 1993 1993 1994 1994 /******************************************** 1995 1995 */ 1996 1996 1997 1997 elem *BinExp::toElemBin(IRState *irs,int op) 1998 1998 { 1999 1999 //printf("toElemBin() '%s'\n", toChars()); 2000 2000 2001 2001 Type *tb1 = e1->type->toBasetype(); 2002 2002 Type *tb2 = e2->type->toBasetype(); 2003 2003 2004 if ((tb1->ty == Tarray || tb1->ty == Tsarray) && 2005 (tb2->ty == Tarray || tb2->ty == Tsarray) && 2004 if ((tb1->ty == Tarray || tb1->ty == Tsarray || 2005 tb2->ty == Tarray || tb2->ty == Tsarray) && 2006 tb2->ty != Tvoid && 2006 2007 op != OPeq && op != OPandand && op != OPoror 2007 2008 ) 2008 2009 { 2009 2010 error("Array operation %s not implemented", toChars()); 2010 2011 return el_long(type->totym(), 0); // error recovery 2011 2012 } 2012 2013 2013 2014 tym_t tym = type->totym(); 2014 2015 2015 2016 elem *el = e1->toElem(irs); 2016 2017 elem *er = e2->toElem(irs); 2017 2018 elem *e = el_bin(op,tym,el,er); 2018 2019 2019 2020 el_setLoc(e,loc); 2020 2021 return e; 2021 2022 } 2022 2023 2023 2024 /*************************************** 2024 2025 */ 2025 2026
