Mercurial > projects > ldc
comparison gen/toir.cpp @ 859:a719f2ca3e92
Applied modification of wilsonk's patch for AndAnd and OrOrExp for void rhs funcs.
author | Christian Kamm <kamm incasoftware de> |
---|---|
date | Wed, 17 Dec 2008 21:24:17 +0100 |
parents | ebbbf8c3ce93 |
children | 7edce7e58ab1 |
comparison
equal
deleted
inserted
replaced
858:ebbbf8c3ce93 | 859:a719f2ca3e92 |
---|---|
1793 llvm::BranchInst::Create(andand,andandend,ubool,p->scopebb()); | 1793 llvm::BranchInst::Create(andand,andandend,ubool,p->scopebb()); |
1794 | 1794 |
1795 p->scope() = IRScope(andand, andandend); | 1795 p->scope() = IRScope(andand, andandend); |
1796 DValue* v = e2->toElem(p); | 1796 DValue* v = e2->toElem(p); |
1797 | 1797 |
1798 LLValue* vbool = DtoCast(loc, v, Type::tbool)->getRVal(); | 1798 if (!v->isFunc() && v->getType() != Type::tvoid) |
1799 LLValue* uandvbool = llvm::BinaryOperator::Create(llvm::BinaryOperator::And, ubool, vbool,"tmp",p->scopebb()); | 1799 { |
1800 DtoStore(uandvbool,resval); | 1800 LLValue* vbool = DtoCast(loc, v, Type::tbool)->getRVal(); |
1801 LLValue* uandvbool = llvm::BinaryOperator::Create(llvm::BinaryOperator::And, ubool, vbool,"tmp",p->scopebb()); | |
1802 DtoStore(uandvbool,resval); | |
1803 } | |
1804 | |
1801 llvm::BranchInst::Create(andandend,p->scopebb()); | 1805 llvm::BranchInst::Create(andandend,p->scopebb()); |
1802 | |
1803 p->scope() = IRScope(andandend, oldend); | 1806 p->scope() = IRScope(andandend, oldend); |
1804 | 1807 |
1805 resval = DtoLoad(resval); | 1808 resval = DtoLoad(resval); |
1806 return new DImValue(type, resval); | 1809 return new DImValue(type, resval); |
1807 } | 1810 } |
1828 llvm::BranchInst::Create(ororend,oror,ubool,p->scopebb()); | 1831 llvm::BranchInst::Create(ororend,oror,ubool,p->scopebb()); |
1829 | 1832 |
1830 p->scope() = IRScope(oror, ororend); | 1833 p->scope() = IRScope(oror, ororend); |
1831 DValue* v = e2->toElem(p); | 1834 DValue* v = e2->toElem(p); |
1832 | 1835 |
1833 LLValue* vbool = DtoCast(loc, v, Type::tbool)->getRVal(); | 1836 if (!v->isFunc() && v->getType() != Type::tvoid) |
1834 DtoStore(vbool,resval); | 1837 { |
1838 LLValue* vbool = DtoCast(loc, v, Type::tbool)->getRVal(); | |
1839 DtoStore(vbool,resval); | |
1840 } | |
1841 | |
1835 llvm::BranchInst::Create(ororend,p->scopebb()); | 1842 llvm::BranchInst::Create(ororend,p->scopebb()); |
1836 | |
1837 p->scope() = IRScope(ororend, oldend); | 1843 p->scope() = IRScope(ororend, oldend); |
1838 | 1844 |
1839 resval = new llvm::LoadInst(resval,"tmp",p->scopebb()); | 1845 resval = DtoLoad(resval); |
1840 return new DImValue(type, resval); | 1846 return new DImValue(type, resval); |
1841 } | 1847 } |
1842 | 1848 |
1843 ////////////////////////////////////////////////////////////////////////////////////////// | 1849 ////////////////////////////////////////////////////////////////////////////////////////// |
1844 | 1850 |