aboutsummaryrefslogtreecommitdiffstats
path: root/docs/tutorial/LangImpl5.html
diff options
context:
space:
mode:
Diffstat (limited to 'docs/tutorial/LangImpl5.html')
-rw-r--r--docs/tutorial/LangImpl5.html18
1 files changed, 9 insertions, 9 deletions
diff --git a/docs/tutorial/LangImpl5.html b/docs/tutorial/LangImpl5.html
index f3630d0..cad05f7 100644
--- a/docs/tutorial/LangImpl5.html
+++ b/docs/tutorial/LangImpl5.html
@@ -364,7 +364,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");
</pre>
</div>
@@ -796,7 +796,7 @@ references to it will naturally find it in the symbol table.</p>
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");
@@ -815,7 +815,7 @@ will be the value of the loop variable on the next iteration of the loop.</p>
// 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");
</pre>
</div>
@@ -1360,7 +1360,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() {
@@ -1411,7 +1411,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();
@@ -1510,7 +1510,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");
@@ -1521,7 +1521,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.
@@ -1545,13 +1545,13 @@ Value *ForExprAST::Codegen() {
// for expr always returns 0.0.
- return Constant::getNullValue(Type::DoubleTy);
+ return getGlobalContext().getNullValue(Type::DoubleTy);
}
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);