mirror of
https://github.com/ldc-developers/ldc.git
synced 2025-05-08 03:46:02 +03:00
getTrue/getFalse were moved back to ConstantInt
Requires LLVM >= r77685
This commit is contained in:
parent
d5d3ecdb05
commit
0a1d467ac7
3 changed files with 8 additions and 8 deletions
|
@ -784,11 +784,11 @@ LLValue* DtoArrayCompare(Loc& loc, TOK op, DValue* l, DValue* r)
|
||||||
break;
|
break;
|
||||||
case TOKleg:
|
case TOKleg:
|
||||||
skip = true;
|
skip = true;
|
||||||
res = gIR->context().getTrue();
|
res = LLConstantInt::getTrue(gIR->context());
|
||||||
break;
|
break;
|
||||||
case TOKunord:
|
case TOKunord:
|
||||||
skip = true;
|
skip = true;
|
||||||
res = gIR->context().getFalse();
|
res = LLConstantInt::getFalse(gIR->context());
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
|
|
@ -226,7 +226,7 @@ namespace {
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (ConstantExpr::getOr(hasDestructor, hasCustomDelete)
|
if (ConstantExpr::getOr(hasDestructor, hasCustomDelete)
|
||||||
!= A.M.getContext().getFalse())
|
!= ConstantInt::getFalse(A.M.getContext()))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
Ty = MD_GetElement(node, CD_BodyType)->getType();
|
Ty = MD_GetElement(node, CD_BodyType)->getType();
|
||||||
|
@ -307,7 +307,7 @@ static void RemoveCall(CallSite CS, const Analysis& A) {
|
||||||
// Create a "conditional" branch that -simplifycfg can clean up, so we
|
// Create a "conditional" branch that -simplifycfg can clean up, so we
|
||||||
// can keep using the DominatorTree without updating it.
|
// can keep using the DominatorTree without updating it.
|
||||||
BranchInst::Create(Invoke->getNormalDest(), Invoke->getUnwindDest(),
|
BranchInst::Create(Invoke->getNormalDest(), Invoke->getUnwindDest(),
|
||||||
A.M.getContext().getTrue(), Invoke->getParent());
|
ConstantInt::getTrue(A.M.getContext()), Invoke->getParent());
|
||||||
}
|
}
|
||||||
// Remove the runtime call.
|
// Remove the runtime call.
|
||||||
if (A.CGNode)
|
if (A.CGNode)
|
||||||
|
|
|
@ -1356,11 +1356,11 @@ DValue* CmpExp::toElem(IRState* p)
|
||||||
break;
|
break;
|
||||||
case TOKleg:
|
case TOKleg:
|
||||||
skip = true;
|
skip = true;
|
||||||
eval = gIR->context().getTrue();
|
eval = LLConstantInt::getTrue(gIR->context());
|
||||||
break;
|
break;
|
||||||
case TOKunord:
|
case TOKunord:
|
||||||
skip = true;
|
skip = true;
|
||||||
eval = gIR->context().getFalse();
|
eval = LLConstantInt::getFalse(gIR->context());
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
@ -1844,7 +1844,7 @@ DValue* AndAndExp::toElem(IRState* p)
|
||||||
llvm::PHINode* phi = p->ir->CreatePHI(LLType::Int1Ty, "andandval");
|
llvm::PHINode* phi = p->ir->CreatePHI(LLType::Int1Ty, "andandval");
|
||||||
// If we jumped over evaluation of the right-hand side,
|
// If we jumped over evaluation of the right-hand side,
|
||||||
// the result is false. Otherwise it's the value of the right-hand side.
|
// the result is false. Otherwise it's the value of the right-hand side.
|
||||||
phi->addIncoming(gIR->context().getFalse(), oldblock);
|
phi->addIncoming(LLConstantInt::getFalse(gIR->context()), oldblock);
|
||||||
phi->addIncoming(vbool, newblock);
|
phi->addIncoming(vbool, newblock);
|
||||||
resval = phi;
|
resval = phi;
|
||||||
}
|
}
|
||||||
|
@ -1891,7 +1891,7 @@ DValue* OrOrExp::toElem(IRState* p)
|
||||||
llvm::PHINode* phi = p->ir->CreatePHI(LLType::Int1Ty, "ororval");
|
llvm::PHINode* phi = p->ir->CreatePHI(LLType::Int1Ty, "ororval");
|
||||||
// If we jumped over evaluation of the right-hand side,
|
// If we jumped over evaluation of the right-hand side,
|
||||||
// the result is true. Otherwise, it's the value of the right-hand side.
|
// the result is true. Otherwise, it's the value of the right-hand side.
|
||||||
phi->addIncoming(gIR->context().getTrue(), oldblock);
|
phi->addIncoming(LLConstantInt::getTrue(gIR->context()), oldblock);
|
||||||
phi->addIncoming(vbool, newblock);
|
phi->addIncoming(vbool, newblock);
|
||||||
resval = phi;
|
resval = phi;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue