From e6819aeee0ccd91d71397c7872aa86b228b6db84 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Tue, 6 Nov 2007 01:39:12 +0000 Subject: fixes from Ryan Brown. llvm-svn: 43747 --- llvm/docs/tutorial/LangImpl5.html | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'llvm/docs/tutorial/LangImpl5.html') diff --git a/llvm/docs/tutorial/LangImpl5.html b/llvm/docs/tutorial/LangImpl5.html index acd60456c81..be82b2dab56 100644 --- a/llvm/docs/tutorial/LangImpl5.html +++ b/llvm/docs/tutorial/LangImpl5.html @@ -319,7 +319,7 @@ block. In this case, if control comes in from the "then" block, it gets the value of "calltmp". If control comes from the "else" block, it gets the value of "calltmp1".

-

At this point, you are probably starting to think "on no! this means my +

At this point, you are probably starting to think "oh no! this means my simple and elegant front-end will have to start generating SSA form in order to use LLVM!". Fortunately, this is not the case, and we strongly advise not implementing an SSA construction algorithm in your front-end @@ -679,8 +679,8 @@ loop: ; preds = %loop, %entry %nextvar = add double %i, 1.000000e+00 ; termination test - %multmp = fcmp ult double %i, %n - %booltmp = uitofp i1 %multmp to double + %cmptmp = fcmp ult double %i, %n + %booltmp = uitofp i1 %cmptmp to double %loopcond = fcmp one double %booltmp, 0.000000e+00 br i1 %loopcond, label %loop, label %afterloop @@ -871,7 +871,8 @@ that is what we return from ForExprAST::Codegen.

the tutorial. We added two control flow constructs, and used them to motivate a couple of aspects of the LLVM IR that are important for front-end implementors to know. In the next chapter of our saga, we will get a bit crazier and add -operator overloading to our poor innocent language.

+user-defined operators to our poor innocent +language.

@@ -1378,7 +1379,7 @@ Value *BinaryExprAST::Codegen() { case '-': return Builder.CreateSub(L, R, "subtmp"); case '*': return Builder.CreateMul(L, R, "multmp"); case '<': - L = Builder.CreateFCmpULT(L, R, "multmp"); + L = Builder.CreateFCmpULT(L, R, "cmptmp"); // Convert bool 0/1 to double 0.0 or 1.0 return Builder.CreateUIToFP(L, Type::DoubleTy, "booltmp"); default: return ErrorV("invalid binary operator"); -- cgit v1.2.3