Mercurial > projects > ldc
comparison gen/toir.cpp @ 1559:06d5cc873350
getTrue/getFalse were moved back to ConstantInt
Requires LLVM >= r77685
author | Benjamin Kramer <benny.kra@gmail.com> |
---|---|
date | Fri, 31 Jul 2009 19:11:07 +0200 |
parents | 4897323d47b5 |
children | 1d5c3354b3c2 |
comparison
equal
deleted
inserted
replaced
1558:3adcb70700cb | 1559:06d5cc873350 |
---|---|
1354 case TOKlg: | 1354 case TOKlg: |
1355 cmpop = llvm::ICmpInst::ICMP_NE; | 1355 cmpop = llvm::ICmpInst::ICMP_NE; |
1356 break; | 1356 break; |
1357 case TOKleg: | 1357 case TOKleg: |
1358 skip = true; | 1358 skip = true; |
1359 eval = gIR->context().getTrue(); | 1359 eval = LLConstantInt::getTrue(gIR->context()); |
1360 break; | 1360 break; |
1361 case TOKunord: | 1361 case TOKunord: |
1362 skip = true; | 1362 skip = true; |
1363 eval = gIR->context().getFalse(); | 1363 eval = LLConstantInt::getFalse(gIR->context()); |
1364 break; | 1364 break; |
1365 | 1365 |
1366 default: | 1366 default: |
1367 assert(0); | 1367 assert(0); |
1368 } | 1368 } |
1842 resval = ubool; | 1842 resval = ubool; |
1843 } else { | 1843 } else { |
1844 llvm::PHINode* phi = p->ir->CreatePHI(LLType::Int1Ty, "andandval"); | 1844 llvm::PHINode* phi = p->ir->CreatePHI(LLType::Int1Ty, "andandval"); |
1845 // If we jumped over evaluation of the right-hand side, | 1845 // If we jumped over evaluation of the right-hand side, |
1846 // the result is false. Otherwise it's the value of the right-hand side. | 1846 // the result is false. Otherwise it's the value of the right-hand side. |
1847 phi->addIncoming(gIR->context().getFalse(), oldblock); | 1847 phi->addIncoming(LLConstantInt::getFalse(gIR->context()), oldblock); |
1848 phi->addIncoming(vbool, newblock); | 1848 phi->addIncoming(vbool, newblock); |
1849 resval = phi; | 1849 resval = phi; |
1850 } | 1850 } |
1851 | 1851 |
1852 return new DImValue(type, resval); | 1852 return new DImValue(type, resval); |
1889 resval = ubool; | 1889 resval = ubool; |
1890 } else { | 1890 } else { |
1891 llvm::PHINode* phi = p->ir->CreatePHI(LLType::Int1Ty, "ororval"); | 1891 llvm::PHINode* phi = p->ir->CreatePHI(LLType::Int1Ty, "ororval"); |
1892 // If we jumped over evaluation of the right-hand side, | 1892 // If we jumped over evaluation of the right-hand side, |
1893 // the result is true. Otherwise, it's the value of the right-hand side. | 1893 // the result is true. Otherwise, it's the value of the right-hand side. |
1894 phi->addIncoming(gIR->context().getTrue(), oldblock); | 1894 phi->addIncoming(LLConstantInt::getTrue(gIR->context()), oldblock); |
1895 phi->addIncoming(vbool, newblock); | 1895 phi->addIncoming(vbool, newblock); |
1896 resval = phi; | 1896 resval = phi; |
1897 } | 1897 } |
1898 | 1898 |
1899 return new DImValue(type, resval); | 1899 return new DImValue(type, resval); |