Dipanjan Das via llvm-dev
2017-Jun-12 05:49 UTC
[llvm-dev] How do I understand LLVM class abstraction better?
I haven't spent any "formal" effort to learn LLVM so far, trying to learn by example. However, the downside is, I struggle with comprehending the semantics of the abstraction provided by several LLVM classes often times. The documentation is miserable. Do you have any suggestion for me to lower the learning threshold? Do seasoned LLVM programmers have faced such problems in early days, or is it the lack of systematic reading that's troubling me? -- Thanks & Regards, Dipanjan -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20170611/0d04d93e/attachment.html>
mats petersson via llvm-dev
2017-Jun-12 11:30 UTC
[llvm-dev] How do I understand LLVM class abstraction better?
I found the Kaleidoscope example a rather good way to learn what I needed (I basically started writing a compiler using the example of Kaleidoscope, and then extended and added more code to eventually have a complete Pascal compiler). Once you get far enough into the project, you can usually formulate a clear & concise enough question for this mailing list or the LLVM chat to get a good answer. And learn "when in doubt, alloca" ;) However, LLVM is a VERY large set of code, and to understand all of it, and the subtle differences between variants ("When is a ConstantValue not a compile-time constant?") that initially appear to be "the same", in some cases, is really not easy. And I'm not sure there is any good answer to "how to do that". I wouldn't even begin to suggest that I actually know ALL of LLVM, certainly not in great detail for everything - there's a lot to do with Target and binary files that I've completely ignored besides "copy/modify from the relevant clang sources". Obviously, if you are not planning to write your own compiler (or work on someone else's compiler project), then perhaps starting at Kaleidoscope is not necessarily the right way. If you explain what it is you're trying to achieve (assuming it's not writing a compiler), perhaps someone has a good suggestion... -- Mats On 12 June 2017 at 06:49, Dipanjan Das via llvm-dev <llvm-dev at lists.llvm.org> wrote:> > I haven't spent any "formal" effort to learn LLVM so far, trying to learn > by example. However, the downside is, I struggle with comprehending the > semantics of the abstraction provided by several LLVM classes often times. > The documentation is miserable. Do you have any suggestion for me to lower > the learning threshold? Do seasoned LLVM programmers have faced such > problems in early days, or is it the lack of systematic reading that's > troubling me? > > -- > > Thanks & Regards, > Dipanjan > > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev > >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20170612/e1065ae6/attachment.html>
陳韋任 via llvm-dev
2017-Jun-14 11:37 UTC
[llvm-dev] How do I understand LLVM class abstraction better?
Or try to grab books about LLVM (free or non-free) to get started. Doxygen [1] would help you understand the class hierarchy better, too. [1] http://llvm.org/doxygen/ HTH, chenwj 2017-06-12 13:49 GMT+08:00 Dipanjan Das via llvm-dev < llvm-dev at lists.llvm.org>:> > I haven't spent any "formal" effort to learn LLVM so far, trying to learn > by example. However, the downside is, I struggle with comprehending the > semantics of the abstraction provided by several LLVM classes often times. > The documentation is miserable. Do you have any suggestion for me to lower > the learning threshold? Do seasoned LLVM programmers have faced such > problems in early days, or is it the lack of systematic reading that's > troubling me? > > -- > > Thanks & Regards, > Dipanjan > > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev > >-- Wei-Ren Chen (陳韋任) Homepage: https://people.cs.nctu.edu.tw/~chenwj -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20170614/0f85423c/attachment.html>
Thomas Krüger via llvm-dev
2017-Jun-25 07:48 UTC
[llvm-dev] How do I understand LLVM class abstraction better?
Hi Dipanjan, I have the same problems, so your are not alone. ;-) Maybe reading this long and helpful discussion could help you: http://lists.llvm.org/pipermail/llvm-dev/2017-May/112730.html Advices I found out by others: - Try to use the Clang compiler to convert very tiny C/C++ language programms into IR code and then try to figure out, how you can generate this IR code with the IR Builder classes. - Try to write absolute exact and very, very compact emails to this LLVM mailing list. Use the keyword "[beginner]" in the email subject, so LLVM developers see it is a beginner question. If the question is very short, hopefully its easy to answered with no time of reading the full description of 30 sentences of the problem. :) Best regards, Thomas Am 12.06.2017 07:49 schrieb Dipanjan Das via llvm-dev:> I haven't spent any "formal" effort to learn LLVM so far, trying to > learn by example. However, the downside is, I struggle with > comprehending the semantics of the abstraction provided by several > LLVM classes often times. The documentation is miserable. Do you have > any suggestion for me to lower the learning threshold? Do seasoned > LLVM programmers have faced such problems in early days, or is it the > lack of systematic reading that's troubling me? > > -- > > Thanks & Regards, > Dipanjan > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev