diff options
author | Owen Anderson <resistor@mac.com> | 2009-07-16 19:05:41 +0000 |
---|---|---|
committer | Owen Anderson <resistor@mac.com> | 2009-07-16 19:05:41 +0000 |
commit | 914e50c841bbc248ab94144c11813b5785b1292d (patch) | |
tree | 264a207cfc9ab42468c68293bbda6da7f4ade3e3 /docs/tutorial/LangImpl6.html | |
parent | dfce3603069fdb6380d3380af434981fcd6e206a (diff) | |
download | external_llvm-914e50c841bbc248ab94144c11813b5785b1292d.zip external_llvm-914e50c841bbc248ab94144c11813b5785b1292d.tar.gz external_llvm-914e50c841bbc248ab94144c11813b5785b1292d.tar.bz2 |
Privatize the ConstantFP table. I'm on a roll!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76097 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'docs/tutorial/LangImpl6.html')
-rw-r--r-- | docs/tutorial/LangImpl6.html | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/docs/tutorial/LangImpl6.html b/docs/tutorial/LangImpl6.html index c0c396b..b10a15f 100644 --- a/docs/tutorial/LangImpl6.html +++ b/docs/tutorial/LangImpl6.html @@ -1365,7 +1365,7 @@ static FunctionPassManager *TheFPM; Value *ErrorV(const char *Str) { Error(Str); return 0; } Value *NumberExprAST::Codegen() { - return ConstantFP::get(APFloat(Val)); + return getGlobalContext().getConstantFP(APFloat(Val)); } Value *VariableExprAST::Codegen() { @@ -1436,7 +1436,7 @@ Value *IfExprAST::Codegen() { // Convert condition to a bool by comparing equal to 0.0. CondV = Builder.CreateFCmpONE(CondV, - ConstantFP::get(APFloat(0.0)), + getGlobalContext().getConstantFP(APFloat(0.0)), "ifcond"); Function *TheFunction = Builder.GetInsertBlock()->getParent(); @@ -1535,7 +1535,7 @@ Value *ForExprAST::Codegen() { if (StepVal == 0) return 0; } else { // If not specified, use 1.0. - StepVal = ConstantFP::get(APFloat(1.0)); + StepVal = getGlobalContext().getConstantFP(APFloat(1.0)); } Value *NextVar = Builder.CreateAdd(Variable, StepVal, "nextvar"); @@ -1546,7 +1546,7 @@ Value *ForExprAST::Codegen() { // Convert condition to a bool by comparing equal to 0.0. EndCond = Builder.CreateFCmpONE(EndCond, - ConstantFP::get(APFloat(0.0)), + getGlobalContext().getConstantFP(APFloat(0.0)), "loopcond"); // Create the "after loop" block and insert it. @@ -1576,7 +1576,7 @@ Value *ForExprAST::Codegen() { Function *PrototypeAST::Codegen() { // Make the function type: double(double,double) etc. std::vector<const Type*> Doubles(Args.size(), Type::DoubleTy); - FunctionType *FT = FunctionType::get(Type::DoubleTy, Doubles, false); + FunctionType *FT = getGlobalContext().getFunctionType(Type::DoubleTy, Doubles, false); Function *F = Function::Create(FT, Function::ExternalLinkage, Name, TheModule); |