comparison gen/llvmhelpers.cpp @ 784:a45179dfaa43

Fix float->bool, #130. Thanks fvbommel.
author Christian Kamm <kamm incasoftware de>
date Sun, 23 Nov 2008 21:57:11 +0100
parents 4adf0f742896
children 661384d6a936
comparison
equal deleted inserted replaced
783:d268bf419a09 784:a45179dfaa43
663 LLValue* rval; 663 LLValue* rval;
664 664
665 if (totype->ty == Tbool) { 665 if (totype->ty == Tbool) {
666 rval = val->getRVal(); 666 rval = val->getRVal();
667 LLValue* zero = LLConstant::getNullValue(rval->getType()); 667 LLValue* zero = LLConstant::getNullValue(rval->getType());
668 rval = gIR->ir->CreateFCmpONE(rval, zero, "tmp"); 668 rval = gIR->ir->CreateFCmpUNE(rval, zero, "tmp");
669 } 669 }
670 else if (totype->iscomplex()) { 670 else if (totype->iscomplex()) {
671 return DtoComplex(loc, to, val); 671 return DtoComplex(loc, to, val);
672 } 672 }
673 else if (totype->isfloating()) { 673 else if (totype->isfloating()) {