llvm.org GIT mirror llvm / c7efed6
Fixup debug information references. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227020 91177308-0d34-0410-b5e6-96231b3b80d8 Charlie Turner 4 years ago
3 changed file(s) with 14 addition(s) and 12 deletion(s). Raw diff Collapse all Expand all
7272 about this is how easy and trivial it is to construct SSA form in
7373 LLVM: no, LLVM does *not* require your front-end to construct SSA
7474 form!
75 - `Chapter #8 `_: Conclusion and other useful LLVM
75 - `Chapter #8 `_: Extending the Language: Debug
76 Information - Having built a decent little programming language with
77 control flow, functions and mutable variables, we consider what it
78 takes to add debug information to standalone executables. This debug
79 information will allow you to set breakpoints in Kaleidoscope
80 functions, print out argument variables, and call functions - all
81 from within the debugger!
82 - `Chapter #9 `_: Conclusion and other useful LLVM
7683 tidbits - This chapter wraps up the series by talking about
7784 potential ways to extend the language, but also includes a bunch of
7885 pointers to info about "special topics" like adding garbage
855855 .. literalinclude:: ../../examples/Kaleidoscope/Chapter7/toy.cpp
856856 :language: c++
857857
858 `Next: Conclusion and other useful LLVM tidbits `_
859
858 `Next: Extending the Language: Debug Information `_
859
1313 being a semi-interesting (but probably still useless) toy. :)
1414
1515 It is interesting to see how far we've come, and how little code it has
16 taken. We built the entire lexer, parser, AST, code generator, and an
17 interactive run-loop (with a JIT!) by-hand in under 1000 lines of
18 (non-comment/non-blank) code.
16 taken. We built the entire lexer, parser, AST, code generator, an
17 interactive run-loop (with a JIT!), and emitted debug information in
18 standalone executables - all in under 1000 lines of (non-comment/non-blank)
19 code.
1920
2021 Our little language supports a couple of interesting features: it
2122 supports user defined binary and unary operators, it uses JIT
6768 collection, note that LLVM fully supports `Accurate Garbage
6869 Collection <../GarbageCollection.html>`_ including algorithms that
6970 move objects and need to scan/update the stack.
70 - **debugger support** - LLVM supports generation of `DWARF Debug
71 info <../SourceLevelDebugging.html>`_ which is understood by common
72 debuggers like GDB. Adding support for debug info is fairly
73 straightforward. The best way to understand it is to compile some
74 C/C++ code with "``clang -g -O0``" and taking a look at what it
75 produces.
7671 - **exception handling support** - LLVM supports generation of `zero
7772 cost exceptions <../ExceptionHandling.html>`_ which interoperate with
7873 code compiled in other languages. You could also generate code by