From 6f83c9c6ef0e7f79825a0a8f22941815e4b684c7 Mon Sep 17 00:00:00 2001 From: Owen Anderson Date: Mon, 27 Jul 2009 20:59:43 +0000 Subject: Move ConstantFP construction back to the 2.5-ish API. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77247 91177308-0d34-0410-b5e6-96231b3b80d8 --- examples/Kaleidoscope/toy.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'examples/Kaleidoscope') diff --git a/examples/Kaleidoscope/toy.cpp b/examples/Kaleidoscope/toy.cpp index 1aa9965fa4..6f7f0ee206 100644 --- a/examples/Kaleidoscope/toy.cpp +++ b/examples/Kaleidoscope/toy.cpp @@ -623,7 +623,7 @@ static AllocaInst *CreateEntryBlockAlloca(Function *TheFunction, Value *NumberExprAST::Codegen() { - return getGlobalContext().getConstantFP(APFloat(Val)); + return ConstantFP::get(getGlobalContext(), APFloat(Val)); } Value *VariableExprAST::Codegen() { @@ -716,7 +716,7 @@ Value *IfExprAST::Codegen() { // Convert condition to a bool by comparing equal to 0.0. CondV = Builder.CreateFCmpONE(CondV, - getGlobalContext().getConstantFP(APFloat(0.0)), + ConstantFP::get(getGlobalContext(), APFloat(0.0)), "ifcond"); Function *TheFunction = Builder.GetInsertBlock()->getParent(); @@ -821,7 +821,7 @@ Value *ForExprAST::Codegen() { if (StepVal == 0) return 0; } else { // If not specified, use 1.0. - StepVal = getGlobalContext().getConstantFP(APFloat(1.0)); + StepVal = ConstantFP::get(getGlobalContext(), APFloat(1.0)); } // Compute the end condition. @@ -836,7 +836,7 @@ Value *ForExprAST::Codegen() { // Convert condition to a bool by comparing equal to 0.0. EndCond = Builder.CreateFCmpONE(EndCond, - getGlobalContext().getConstantFP(APFloat(0.0)), + ConstantFP::get(getGlobalContext(), APFloat(0.0)), "loopcond"); // Create the "after loop" block and insert it. @@ -879,7 +879,7 @@ Value *VarExprAST::Codegen() { InitVal = Init->Codegen(); if (InitVal == 0) return 0; } else { // If not specified, use 0.0. - InitVal = getGlobalContext().getConstantFP(APFloat(0.0)); + InitVal = ConstantFP::get(getGlobalContext(), APFloat(0.0)); } AllocaInst *Alloca = CreateEntryBlockAlloca(TheFunction, VarName); -- cgit v1.2.3