<div class="doc_code">
<pre>
Value *NumberExprAST::Codegen() {
<div class="doc_code">
<pre>
Value *NumberExprAST::Codegen() {
- return ConstantFP::get(Type::DoubleTy, APFloat(Val));
+ return ConstantFP::get(APFloat(Val));
Value *ErrorV(const char *Str) { Error(Str); return 0; }
Value *NumberExprAST::Codegen() {
Value *ErrorV(const char *Str) { Error(Str); return 0; }
Value *NumberExprAST::Codegen() {
- return ConstantFP::get(Type::DoubleTy, APFloat(Val));
+ return ConstantFP::get(APFloat(Val));
}
Value *VariableExprAST::Codegen() {
}
Value *VariableExprAST::Codegen() {
Value *ErrorV(const char *Str) { Error(Str); return 0; }
Value *NumberExprAST::Codegen() {
Value *ErrorV(const char *Str) { Error(Str); return 0; }
Value *NumberExprAST::Codegen() {
- return ConstantFP::get(Type::DoubleTy, APFloat(Val));
+ return ConstantFP::get(APFloat(Val));
}
Value *VariableExprAST::Codegen() {
}
Value *VariableExprAST::Codegen() {
// Convert condition to a bool by comparing equal to 0.0.
CondV = Builder.CreateFCmpONE(CondV,
// Convert condition to a bool by comparing equal to 0.0.
CondV = Builder.CreateFCmpONE(CondV,
- ConstantFP::get(Type::DoubleTy, APFloat(0.0)),
+ ConstantFP::get(APFloat(0.0)),
if (StepVal == 0) return 0;
} else {
// If not specified, use 1.0.
if (StepVal == 0) return 0;
} else {
// If not specified, use 1.0.
- StepVal = ConstantFP::get(Type::DoubleTy, APFloat(1.0));
+ StepVal = ConstantFP::get(APFloat(1.0));
}
Value *NextVar = Builder.CreateAdd(Variable, StepVal, "nextvar");
}
Value *NextVar = Builder.CreateAdd(Variable, StepVal, "nextvar");
// Convert condition to a bool by comparing equal to 0.0.
EndCond = Builder.CreateFCmpONE(EndCond,
// Convert condition to a bool by comparing equal to 0.0.
EndCond = Builder.CreateFCmpONE(EndCond,
- ConstantFP::get(Type::DoubleTy, APFloat(0.0)),
+ ConstantFP::get(APFloat(0.0)),
"loopcond");
</pre>
</div>
"loopcond");
</pre>
</div>
Value *ErrorV(const char *Str) { Error(Str); return 0; }
Value *NumberExprAST::Codegen() {
Value *ErrorV(const char *Str) { Error(Str); return 0; }
Value *NumberExprAST::Codegen() {
- return ConstantFP::get(Type::DoubleTy, APFloat(Val));
+ return ConstantFP::get(APFloat(Val));
}
Value *VariableExprAST::Codegen() {
}
Value *VariableExprAST::Codegen() {
// Convert condition to a bool by comparing equal to 0.0.
CondV = Builder.CreateFCmpONE(CondV,
// Convert condition to a bool by comparing equal to 0.0.
CondV = Builder.CreateFCmpONE(CondV,
- ConstantFP::get(Type::DoubleTy, APFloat(0.0)),
+ ConstantFP::get(APFloat(0.0)),
"ifcond");
Function *TheFunction = Builder.GetInsertBlock()->getParent();
"ifcond");
Function *TheFunction = Builder.GetInsertBlock()->getParent();
if (StepVal == 0) return 0;
} else {
// If not specified, use 1.0.
if (StepVal == 0) return 0;
} else {
// If not specified, use 1.0.
- StepVal = ConstantFP::get(Type::DoubleTy, APFloat(1.0));
+ StepVal = ConstantFP::get(APFloat(1.0));
}
Value *NextVar = Builder.CreateAdd(Variable, StepVal, "nextvar");
}
Value *NextVar = Builder.CreateAdd(Variable, StepVal, "nextvar");
// Convert condition to a bool by comparing equal to 0.0.
EndCond = Builder.CreateFCmpONE(EndCond,
// Convert condition to a bool by comparing equal to 0.0.
EndCond = Builder.CreateFCmpONE(EndCond,
- ConstantFP::get(Type::DoubleTy, APFloat(0.0)),
+ ConstantFP::get(APFloat(0.0)),
"loopcond");
// Create the "after loop" block and insert it.
"loopcond");
// Create the "after loop" block and insert it.
Value *ErrorV(const char *Str) { Error(Str); return 0; }
Value *NumberExprAST::Codegen() {
Value *ErrorV(const char *Str) { Error(Str); return 0; }
Value *NumberExprAST::Codegen() {
- return ConstantFP::get(Type::DoubleTy, APFloat(Val));
+ return ConstantFP::get(APFloat(Val));
}
Value *VariableExprAST::Codegen() {
}
Value *VariableExprAST::Codegen() {
// Convert condition to a bool by comparing equal to 0.0.
CondV = Builder.CreateFCmpONE(CondV,
// Convert condition to a bool by comparing equal to 0.0.
CondV = Builder.CreateFCmpONE(CondV,
- ConstantFP::get(Type::DoubleTy, APFloat(0.0)),
+ ConstantFP::get(APFloat(0.0)),
"ifcond");
Function *TheFunction = Builder.GetInsertBlock()->getParent();
"ifcond");
Function *TheFunction = Builder.GetInsertBlock()->getParent();
if (StepVal == 0) return 0;
} else {
// If not specified, use 1.0.
if (StepVal == 0) return 0;
} else {
// If not specified, use 1.0.
- StepVal = ConstantFP::get(Type::DoubleTy, APFloat(1.0));
+ StepVal = ConstantFP::get(APFloat(1.0));
}
Value *NextVar = Builder.CreateAdd(Variable, StepVal, "nextvar");
}
Value *NextVar = Builder.CreateAdd(Variable, StepVal, "nextvar");
// Convert condition to a bool by comparing equal to 0.0.
EndCond = Builder.CreateFCmpONE(EndCond,
// Convert condition to a bool by comparing equal to 0.0.
EndCond = Builder.CreateFCmpONE(EndCond,
- ConstantFP::get(Type::DoubleTy, APFloat(0.0)),
+ ConstantFP::get(APFloat(0.0)),
"loopcond");
// Create the "after loop" block and insert it.
"loopcond");
// Create the "after loop" block and insert it.
InitVal = Init->Codegen();
if (InitVal == 0) return 0;
} else { // If not specified, use 0.0.
InitVal = Init->Codegen();
if (InitVal == 0) return 0;
} else { // If not specified, use 0.0.
- InitVal = ConstantFP::get(Type::DoubleTy, APFloat(0.0));
+ InitVal = ConstantFP::get(APFloat(0.0));
}
AllocaInst *Alloca = CreateEntryBlockAlloca(TheFunction, VarName);
}
AllocaInst *Alloca = CreateEntryBlockAlloca(TheFunction, VarName);
Value *NumberExprAST::Codegen() {
Value *NumberExprAST::Codegen() {
- return ConstantFP::get(Type::DoubleTy, APFloat(Val));
+ return ConstantFP::get(APFloat(Val));
}
Value *VariableExprAST::Codegen() {
}
Value *VariableExprAST::Codegen() {
// Convert condition to a bool by comparing equal to 0.0.
CondV = Builder.CreateFCmpONE(CondV,
// Convert condition to a bool by comparing equal to 0.0.
CondV = Builder.CreateFCmpONE(CondV,
- ConstantFP::get(Type::DoubleTy, APFloat(0.0)),
+ ConstantFP::get(APFloat(0.0)),
"ifcond");
Function *TheFunction = Builder.GetInsertBlock()->getParent();
"ifcond");
Function *TheFunction = Builder.GetInsertBlock()->getParent();
if (StepVal == 0) return 0;
} else {
// If not specified, use 1.0.
if (StepVal == 0) return 0;
} else {
// If not specified, use 1.0.
- StepVal = ConstantFP::get(Type::DoubleTy, APFloat(1.0));
+ StepVal = ConstantFP::get(APFloat(1.0));
}
// Compute the end condition.
}
// Compute the end condition.
// Convert condition to a bool by comparing equal to 0.0.
EndCond = Builder.CreateFCmpONE(EndCond,
// Convert condition to a bool by comparing equal to 0.0.
EndCond = Builder.CreateFCmpONE(EndCond,
- ConstantFP::get(Type::DoubleTy, APFloat(0.0)),
+ ConstantFP::get(APFloat(0.0)),
"loopcond");
// Create the "after loop" block and insert it.
"loopcond");
// Create the "after loop" block and insert it.
InitVal = Init->Codegen();
if (InitVal == 0) return 0;
} else { // If not specified, use 0.0.
InitVal = Init->Codegen();
if (InitVal == 0) return 0;
} else { // If not specified, use 0.0.
- InitVal = ConstantFP::get(Type::DoubleTy, APFloat(0.0));
+ InitVal = ConstantFP::get(APFloat(0.0));
}
AllocaInst *Alloca = CreateEntryBlockAlloca(TheFunction, VarName);
}
AllocaInst *Alloca = CreateEntryBlockAlloca(TheFunction, VarName);