mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-23 22:23:00 +00:00
Update the tutorial to match changes to examples/Kaleidoscope.
One change I'm not folding in is the removal of two unused variables that caused warnings, because those were there for expository purposes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81721 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -206,7 +206,8 @@ Value *BinaryExprAST::Codegen() {
|
||||
case '<':
|
||||
L = Builder.CreateFCmpULT(L, R, "cmptmp");
|
||||
// Convert bool 0/1 to double 0.0 or 1.0
|
||||
return Builder.CreateUIToFP(L, Type::getDoubleTy(getGlobalContext()), "booltmp");
|
||||
return Builder.CreateUIToFP(L, Type::getDoubleTy(getGlobalContext()),
|
||||
"booltmp");
|
||||
default: return ErrorV("invalid binary operator");
|
||||
}
|
||||
}
|
||||
@@ -307,8 +308,10 @@ bodies and external function declarations. The code starts with:</p>
|
||||
<pre>
|
||||
Function *PrototypeAST::Codegen() {
|
||||
// Make the function type: double(double,double) etc.
|
||||
std::vector<const Type*> Doubles(Args.size(), Type::getDoubleTy(getGlobalContext()));
|
||||
FunctionType *FT = FunctionType::get(Type::getDoubleTy(getGlobalContext()), Doubles, false);
|
||||
std::vector<const Type*> Doubles(Args.size(),
|
||||
Type::getDoubleTy(getGlobalContext()));
|
||||
FunctionType *FT = FunctionType::get(Type::getDoubleTy(getGlobalContext()),
|
||||
Doubles, false);
|
||||
|
||||
Function *F = Function::Create(FT, Function::ExternalLinkage, Name, TheModule);
|
||||
</pre>
|
||||
@@ -1081,8 +1084,10 @@ Value *CallExprAST::Codegen() {
|
||||
|
||||
Function *PrototypeAST::Codegen() {
|
||||
// Make the function type: double(double,double) etc.
|
||||
std::vector<const Type*> Doubles(Args.size(), Type::getDoubleTy(getGlobalContext()));
|
||||
FunctionType *FT = FunctionType::get(Type::getDoubleTy(getGlobalContext()), Doubles, false);
|
||||
std::vector<const Type*> Doubles(Args.size(),
|
||||
Type::getDoubleTy(getGlobalContext()));
|
||||
FunctionType *FT = FunctionType::get(Type::getDoubleTy(getGlobalContext()),
|
||||
Doubles, false);
|
||||
|
||||
Function *F = Function::Create(FT, Function::ExternalLinkage, Name, TheModule);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user