diff options
author | Chris Lattner <sabre@nondot.org> | 2007-11-06 01:39:12 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2007-11-06 01:39:12 +0000 |
commit | e6819aeee0ccd91d71397c7872aa86b228b6db84 (patch) | |
tree | 4fff12d178e007d6ed805b25469d00afe2e632e4 /llvm/docs/tutorial/LangImpl5.html | |
parent | 0d28238a1f642c2dbe4c16a730be31064619a7f4 (diff) | |
download | bcm5719-llvm-e6819aeee0ccd91d71397c7872aa86b228b6db84.tar.gz bcm5719-llvm-e6819aeee0ccd91d71397c7872aa86b228b6db84.zip |
fixes from Ryan Brown.
llvm-svn: 43747
Diffstat (limited to 'llvm/docs/tutorial/LangImpl5.html')
-rw-r--r-- | llvm/docs/tutorial/LangImpl5.html | 11 |
1 files changed, 6 insertions, 5 deletions
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".</p> -<p>At this point, you are probably starting to think "on no! this means my +<p>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 <em>not</em> 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 <tt>ForExprAST::Codegen</tt>.</p> 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.</p> +<a href="LangImpl6.html">user-defined operators</a> to our poor innocent +language.</p> </div> @@ -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"); |