summaryrefslogtreecommitdiffstats
path: root/llvm/docs/tutorial/LangImpl7.html
diff options
context:
space:
mode:
authorOwen Anderson <resistor@mac.com>2009-07-16 19:05:41 +0000
committerOwen Anderson <resistor@mac.com>2009-07-16 19:05:41 +0000
commitc277dc408bea3697fbaa3429658c4d8deff3f066 (patch)
treef65e750a09ae0ea781e0dc379886adaf7be21a77 /llvm/docs/tutorial/LangImpl7.html
parentbf61e3b4d3fd81eb65c44bd71b6e001127906b98 (diff)
downloadbcm5719-llvm-c277dc408bea3697fbaa3429658c4d8deff3f066.tar.gz
bcm5719-llvm-c277dc408bea3697fbaa3429658c4d8deff3f066.zip
Privatize the ConstantFP table. I'm on a roll!
llvm-svn: 76097
Diffstat (limited to 'llvm/docs/tutorial/LangImpl7.html')
-rw-r--r--llvm/docs/tutorial/LangImpl7.html14
1 files changed, 7 insertions, 7 deletions
diff --git a/llvm/docs/tutorial/LangImpl7.html b/llvm/docs/tutorial/LangImpl7.html
index 157b7dda459..9424223fd77 100644
--- a/llvm/docs/tutorial/LangImpl7.html
+++ b/llvm/docs/tutorial/LangImpl7.html
@@ -923,7 +923,7 @@ that we replace in OldBindings.</p>
InitVal = Init-&gt;Codegen();
if (InitVal == 0) return 0;
} else { // If not specified, use 0.0.
- InitVal = ConstantFP::get(APFloat(0.0));
+ InitVal = getGlobalContext().getConstantFP(APFloat(0.0));
}
AllocaInst *Alloca = CreateEntryBlockAlloca(TheFunction, VarName);
@@ -1623,7 +1623,7 @@ static AllocaInst *CreateEntryBlockAlloca(Function *TheFunction,
Value *NumberExprAST::Codegen() {
- return ConstantFP::get(APFloat(Val));
+ return getGlobalContext().getConstantFP(APFloat(Val));
}
Value *VariableExprAST::Codegen() {
@@ -1716,7 +1716,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()-&gt;getParent();
@@ -1822,7 +1822,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));
}
// Compute the end condition.
@@ -1837,7 +1837,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.
@@ -1881,7 +1881,7 @@ Value *VarExprAST::Codegen() {
InitVal = Init-&gt;Codegen();
if (InitVal == 0) return 0;
} else { // If not specified, use 0.0.
- InitVal = ConstantFP::get(APFloat(0.0));
+ InitVal = getGlobalContext().getConstantFP(APFloat(0.0));
}
AllocaInst *Alloca = CreateEntryBlockAlloca(TheFunction, VarName);
@@ -1911,7 +1911,7 @@ Value *VarExprAST::Codegen() {
Function *PrototypeAST::Codegen() {
// Make the function type: double(double,double) etc.
std::vector&lt;const Type*&gt; 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);
OpenPOWER on IntegriCloud