From 0a1d467ac7e22d48714b2e83a1aa657e6a74ee5b Mon Sep 17 00:00:00 2001 From: Benjamin Kramer Date: Fri, 31 Jul 2009 19:11:07 +0200 Subject: [PATCH] getTrue/getFalse were moved back to ConstantInt Requires LLVM >= r77685 --- gen/arrays.cpp | 4 ++-- gen/passes/GarbageCollect2Stack.cpp | 4 ++-- gen/toir.cpp | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/gen/arrays.cpp b/gen/arrays.cpp index f92350f1..d326fa73 100644 --- a/gen/arrays.cpp +++ b/gen/arrays.cpp @@ -784,11 +784,11 @@ LLValue* DtoArrayCompare(Loc& loc, TOK op, DValue* l, DValue* r) break; case TOKleg: skip = true; - res = gIR->context().getTrue(); + res = LLConstantInt::getTrue(gIR->context()); break; case TOKunord: skip = true; - res = gIR->context().getFalse(); + res = LLConstantInt::getFalse(gIR->context()); break; default: diff --git a/gen/passes/GarbageCollect2Stack.cpp b/gen/passes/GarbageCollect2Stack.cpp index c990d920..0a75c86a 100644 --- a/gen/passes/GarbageCollect2Stack.cpp +++ b/gen/passes/GarbageCollect2Stack.cpp @@ -226,7 +226,7 @@ namespace { return false; if (ConstantExpr::getOr(hasDestructor, hasCustomDelete) - != A.M.getContext().getFalse()) + != ConstantInt::getFalse(A.M.getContext())) return false; 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 // can keep using the DominatorTree without updating it. BranchInst::Create(Invoke->getNormalDest(), Invoke->getUnwindDest(), - A.M.getContext().getTrue(), Invoke->getParent()); + ConstantInt::getTrue(A.M.getContext()), Invoke->getParent()); } // Remove the runtime call. if (A.CGNode) diff --git a/gen/toir.cpp b/gen/toir.cpp index ea1482b0..7fae163b 100644 --- a/gen/toir.cpp +++ b/gen/toir.cpp @@ -1356,11 +1356,11 @@ DValue* CmpExp::toElem(IRState* p) break; case TOKleg: skip = true; - eval = gIR->context().getTrue(); + eval = LLConstantInt::getTrue(gIR->context()); break; case TOKunord: skip = true; - eval = gIR->context().getFalse(); + eval = LLConstantInt::getFalse(gIR->context()); break; default: @@ -1844,7 +1844,7 @@ DValue* AndAndExp::toElem(IRState* p) llvm::PHINode* phi = p->ir->CreatePHI(LLType::Int1Ty, "andandval"); // If we jumped over evaluation 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); resval = phi; } @@ -1891,7 +1891,7 @@ DValue* OrOrExp::toElem(IRState* p) llvm::PHINode* phi = p->ir->CreatePHI(LLType::Int1Ty, "ororval"); // If we jumped over evaluation 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); resval = phi; }