diff --git a/clang/lib/CodeGen/CGCXXTemp.cpp b/clang/lib/CodeGen/CGCXXTemp.cpp index b96f04dbe72c..c7ac4150b485 100644 --- a/clang/lib/CodeGen/CGCXXTemp.cpp +++ b/clang/lib/CodeGen/CGCXXTemp.cpp @@ -29,12 +29,12 @@ void CodeGenFunction::PushCXXTemporary(const CXXTemporary *Temporary, // Initialize it to false. This initialization takes place right after // the alloca insert point. llvm::StoreInst *SI = - new llvm::StoreInst(VMContext.getFalse(), CondPtr); + new llvm::StoreInst(llvm::ConstantInt::getFalse(VMContext), CondPtr); llvm::BasicBlock *Block = AllocaInsertPt->getParent(); Block->getInstList().insertAfter((llvm::Instruction *)AllocaInsertPt, SI); // Now set it to true. - Builder.CreateStore(VMContext.getTrue(), CondPtr); + Builder.CreateStore(llvm::ConstantInt::getTrue(VMContext), CondPtr); } LiveTemporaries.push_back(CXXLiveTemporaryInfo(Temporary, Ptr, DtorBlock, @@ -74,7 +74,7 @@ void CodeGenFunction::PopCXXTemporary() { if (CondEnd) { // Reset the condition. to false. - Builder.CreateStore(VMContext.getFalse(), Info.CondPtr); + Builder.CreateStore(llvm::ConstantInt::getFalse(VMContext), Info.CondPtr); EmitBlock(CondEnd); } diff --git a/clang/lib/CodeGen/CGExprScalar.cpp b/clang/lib/CodeGen/CGExprScalar.cpp index dd163a988e5c..baf007991c4e 100644 --- a/clang/lib/CodeGen/CGExprScalar.cpp +++ b/clang/lib/CodeGen/CGExprScalar.cpp @@ -729,7 +729,7 @@ Value *ScalarExprEmitter::VisitPrePostIncDec(const UnaryOperator *E, // Bool = ((int)Bool+1) != 0 // An interesting aspect of this is that increment is always true. // Decrement does not have this property. - NextVal = VMContext.getTrue(); + NextVal = llvm::ConstantInt::getTrue(VMContext); } else if (isa(InVal->getType())) { NextVal = llvm::ConstantInt::get(InVal->getType(), AmountVal); NextVal = Builder.CreateAdd(InVal, NextVal, isInc ? "inc" : "dec"); @@ -1327,7 +1327,7 @@ Value *ScalarExprEmitter::VisitBinLAnd(const BinaryOperator *E) { PN->reserveOperandSpace(2); // Normal case, two inputs. for (llvm::pred_iterator PI = pred_begin(ContBlock), PE = pred_end(ContBlock); PI != PE; ++PI) - PN->addIncoming(VMContext.getFalse(), *PI); + PN->addIncoming(llvm::ConstantInt::getFalse(VMContext), *PI); CGF.PushConditionalTempDestruction(); CGF.EmitBlock(RHSBlock); @@ -1374,7 +1374,7 @@ Value *ScalarExprEmitter::VisitBinLOr(const BinaryOperator *E) { PN->reserveOperandSpace(2); // Normal case, two inputs. for (llvm::pred_iterator PI = pred_begin(ContBlock), PE = pred_end(ContBlock); PI != PE; ++PI) - PN->addIncoming(VMContext.getTrue(), *PI); + PN->addIncoming(llvm::ConstantInt::getTrue(VMContext), *PI); CGF.PushConditionalTempDestruction(); diff --git a/clang/lib/CodeGen/CGObjCMac.cpp b/clang/lib/CodeGen/CGObjCMac.cpp index f759e4a93eab..45a4bcef203f 100644 --- a/clang/lib/CodeGen/CGObjCMac.cpp +++ b/clang/lib/CodeGen/CGObjCMac.cpp @@ -2472,7 +2472,7 @@ void CGObjCMac::EmitTryOrSynchronizedStmt(CodeGen::CodeGenFunction &CGF, "_rethrow"); llvm::Value *CallTryExitPtr = CGF.CreateTempAlloca(llvm::Type::Int1Ty, "_call_try_exit"); - CGF.Builder.CreateStore(VMContext.getTrue(), CallTryExitPtr); + CGF.Builder.CreateStore(llvm::ConstantInt::getTrue(VMContext), CallTryExitPtr); // Enter a new try block and call setjmp. CGF.Builder.CreateCall(ObjCTypes.getExceptionTryEnterFn(), ExceptionData); @@ -2505,7 +2505,7 @@ void CGObjCMac::EmitTryOrSynchronizedStmt(CodeGen::CodeGenFunction &CGF, if (!isTry) { CGF.Builder.CreateStore(Caught, RethrowPtr); - CGF.Builder.CreateStore(VMContext.getFalse(), CallTryExitPtr); + CGF.Builder.CreateStore(llvm::ConstantInt::getFalse(VMContext), CallTryExitPtr); CGF.EmitBranchThroughCleanup(FinallyRethrow); } else if (const ObjCAtCatchStmt* CatchStmt = cast(S).getCatchStmts()) { @@ -2604,11 +2604,11 @@ void CGObjCMac::EmitTryOrSynchronizedStmt(CodeGen::CodeGenFunction &CGF, CGF.Builder.CreateCall(ObjCTypes.getExceptionExtractFn(), ExceptionData), RethrowPtr); - CGF.Builder.CreateStore(VMContext.getFalse(), CallTryExitPtr); + CGF.Builder.CreateStore(llvm::ConstantInt::getFalse(VMContext), CallTryExitPtr); CGF.EmitBranchThroughCleanup(FinallyRethrow); } else { CGF.Builder.CreateStore(Caught, RethrowPtr); - CGF.Builder.CreateStore(VMContext.getFalse(), CallTryExitPtr); + CGF.Builder.CreateStore(llvm::ConstantInt::getFalse(VMContext), CallTryExitPtr); CGF.EmitBranchThroughCleanup(FinallyRethrow); }