Chris Lattner
2007-Nov-05 18:14 UTC
[LLVMdev] 'Implementing a language with LLVM' tutorial
On Mon, 5 Nov 2007, Aaron Gray wrote:>> Anyone have thoughts or feedback? :) > > Nice job. The only bit that is not immediately clear is the 'Proto' > variable, but is clear when looking through the code at the end of the page.Where in the tutorial? What would you suggest that I say?> Could do with a link to the LLVMBuilder class reference material.I added a link to the doxygen info, thanks! -Chris -- http://nondot.org/sabre/ http://llvm.org/
Very nice. Here's a couple comments on the first 6 chapters: http://llvm.org/docs/tutorial/LangImpl1.html "We handle comments by skipping to the end of the line and then returning the next comment." Shouldn't this say "returning the next comment"? http://llvm.org/docs/tutorial/LangImpl2.html I was a bit confused at first because the AST node classes are called ASTs. Instead of saying "ExprAST node" all the time, who not just call the class ExprNode or ExprAstNode? http://llvm.org/docs/tutorial/LangImpl3.html case '<': L = Builder.CreateFCmpULT(L, R, "multmp"); Should this be something like "cmptmp"? Also, you mention zero-argument functions, but it doesn't look like you can parse function calls with zero arguments. http://llvm.org/docs/tutorial/LangImpl5.html At this point, you are probably starting to think "on no! Should be "Oh no" There's no link to the next chapter at the end of this chapter. On 11/5/07, Chris Lattner <sabre at nondot.org> wrote:> On Mon, 5 Nov 2007, Aaron Gray wrote: > >> Anyone have thoughts or feedback? :) > > > > Nice job. The only bit that is not immediately clear is the 'Proto' > > variable, but is clear when looking through the code at the end of the page. > > Where in the tutorial? What would you suggest that I say? > > > Could do with a link to the LLVMBuilder class reference material. > > I added a link to the doxygen info, thanks! > > -Chris > > -- > http://nondot.org/sabre/ > http://llvm.org/ > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >-- Ryan Brown Gws UI Team
Also it looks like there's a typo in ch 8: As one trivial example, it is possible to add language-specific optimization passes that "known" things about code compiled for a language. Should say [passes that "know" things]. On 11/5/07, Ryan Brown <ribrdb at google.com> wrote:> Very nice. Here's a couple comments on the first 6 chapters: > http://llvm.org/docs/tutorial/LangImpl1.html > "We handle comments by skipping to the end of the line and then > returning the next comment." > > Shouldn't this say "returning the next comment"? > > http://llvm.org/docs/tutorial/LangImpl2.html > I was a bit confused at first because the AST node classes are called > ASTs. Instead of saying "ExprAST node" all the time, who not just call > the class ExprNode or ExprAstNode? > > http://llvm.org/docs/tutorial/LangImpl3.html > case '<': > L = Builder.CreateFCmpULT(L, R, "multmp"); > Should this be something like "cmptmp"? > > Also, you mention zero-argument functions, but it doesn't look like > you can parse function calls with zero arguments. > > > http://llvm.org/docs/tutorial/LangImpl5.html > At this point, you are probably starting to think "on no! > Should be "Oh no" > > There's no link to the next chapter at the end of this chapter. > > > On 11/5/07, Chris Lattner <sabre at nondot.org> wrote: > > On Mon, 5 Nov 2007, Aaron Gray wrote: > > >> Anyone have thoughts or feedback? :) > > > > > > Nice job. The only bit that is not immediately clear is the 'Proto' > > > variable, but is clear when looking through the code at the end of the page. > > > > Where in the tutorial? What would you suggest that I say? > > > > > Could do with a link to the LLVMBuilder class reference material. > > > > I added a link to the doxygen info, thanks! > > > > -Chris > > > > -- > > http://nondot.org/sabre/ > > http://llvm.org/ > > _______________________________________________ > > LLVM Developers mailing list > > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev > > > > > > -- > Ryan Brown > Gws UI Team >-- Ryan Brown Gws UI Team
Chris Lattner
2007-Nov-06 01:53 UTC
[LLVMdev] 'Implementing a language with LLVM' tutorial
On Mon, 5 Nov 2007, Ryan Brown wrote:> Very nice. Here's a couple comments on the first 6 chapters: > http://llvm.org/docs/tutorial/LangImpl1.html > "We handle comments by skipping to the end of the line and then > returning the next comment." > > Shouldn't this say "returning the next comment"?Fixed.> http://llvm.org/docs/tutorial/LangImpl2.html > I was a bit confused at first because the AST node classes are called > ASTs. Instead of saying "ExprAST node" all the time, who not just call > the class ExprNode or ExprAstNode?I don't think ExprNode or ExprASTNode is more clear than ExprAST. "ExprAST" is the right thing because they are AST's and they are Expr specific.> http://llvm.org/docs/tutorial/LangImpl3.html > case '<': > L = Builder.CreateFCmpULT(L, R, "multmp"); > Should this be something like "cmptmp"?What a pain. Fixed :)> Also, you mention zero-argument functions, but it doesn't look like > you can parse function calls with zero arguments.Also painful to fix, but also fixed. Thanks.> http://llvm.org/docs/tutorial/LangImpl5.html > At this point, you are probably starting to think "on no! > Should be "Oh no"Fixed> There's no link to the next chapter at the end of this chapter.Fixed. Thanks Ryan, -Chris> On 11/5/07, Chris Lattner <sabre at nondot.org> wrote: >> On Mon, 5 Nov 2007, Aaron Gray wrote: >>>> Anyone have thoughts or feedback? :) >>> >>> Nice job. The only bit that is not immediately clear is the 'Proto' >>> variable, but is clear when looking through the code at the end of the page. >> >> Where in the tutorial? What would you suggest that I say? >> >>> Could do with a link to the LLVMBuilder class reference material. >> >> I added a link to the doxygen info, thanks! >> >> -Chris >> >> -- >> http://nondot.org/sabre/ >> http://llvm.org/ >> _______________________________________________ >> LLVM Developers mailing list >> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu >> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >> > > >-Chris -- http://nondot.org/sabre/ http://llvm.org/
> On Mon, 5 Nov 2007, Aaron Gray wrote: >> Nice job. The only bit that is not immediately clear is the 'Proto' >> variable, but is clear when looking through the code at the end of the >> page. > > Where in the tutorial? What would you suggest that I say?First reference in 'Function *FunctionAST::Codegen()'. What Proto is is not totally clear till you look at the complete code at the end of the page. A minor point.>> Could do with a link to the LLVMBuilder class reference material. > > I added a link to the doxygen info, thanks!It might be an idea to add a download link for the complete code to save user having to cut and paste it to try it. A minor point. Aaron
Chris Lattner
2007-Nov-06 05:08 UTC
[LLVMdev] 'Implementing a language with LLVM' tutorial
On Nov 5, 2007, at 6:05 PM, Aaron Gray wrote:>> On Mon, 5 Nov 2007, Aaron Gray wrote: >>> Nice job. The only bit that is not immediately clear is the 'Proto' >>> variable, but is clear when looking through the code at the end of >>> the >>> page. >> >> Where in the tutorial? What would you suggest that I say? > > First reference in 'Function *FunctionAST::Codegen()'. What Proto is > is not > totally clear till you look at the complete code at the end of the > page. A > minor point.It's still unclear where you are talking about this. I clarified the prose in chapter 3 that first describes FunctionAST::Codegen. If you still think it is unclear, please propose new wording, thanks!>>> Could do with a link to the LLVMBuilder class reference material. >> >> I added a link to the doxygen info, thanks! > > It might be an idea to add a download link for the complete code to > save > user having to cut and paste it to try it. A minor point.As I told Owen: "If the user can't copy and paste, there is no hope for them". It's not worth the burden to maintain yet another copy of every piece of source that has to be updated when changes are made. -Chris