Commit Graph

205 Commits

Author SHA1 Message Date
Duncan P. N. Exon Smith
aa50fa7c2f DI: Rewrite the DIBuilder local variable API
Replace the general `createLocalVariable()` with two more specific
functions: `createParameterVariable()` and `createAutoVariable()`, and
rewrite the documentation.

Besides cleaning up the API, this avoids exposing the fake DWARF tags
`DW_TAG_arg_variable` and `DW_TAG_auto_variable` to frontends, and is
preparation for removing them completely.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243764 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-31 17:55:53 +00:00
Duncan P. N. Exon Smith
cbfbb3ee4c DI/Verifier: Fix argument bitrot in DILocalVariable
Add a verifier check that `DILocalVariable`s of tag
`DW_TAG_arg_variable` always have a non-zero 'arg:' field, and those of
tag `DW_TAG_auto_variable` always have a zero 'arg:' field.  These are
the only configurations that are properly understood by the backend.

(Also, fix the bad examples in LangRef and test/Assembler, and fix the
bug in Kaleidoscope Ch8.)

A large number of testcases seem to have bitrotted their way forward
from some ancient version of the debug info hierarchy that didn't have
`arg:` parameters.  If you have out-of-tree testcases that start failing
in the verifier and you don't care enough to get the `arg:` right, you
may have some luck just calling:

    sed -e 's/, arg: 0/, arg: 1/'

or some such, but I hand-updated the ones in tree.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243183 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-24 23:59:25 +00:00
Duncan P. N. Exon Smith
e56023a059 IR: Give 'DI' prefix to debug info metadata
Finish off PR23080 by renaming the debug info IR constructs from `MD*`
to `DI*`.  The last of the `DIDescriptor` classes were deleted in
r235356, and the last of the related typedefs removed in r235413, so
this has all baked for about a week.

Note: If you have out-of-tree code (like a frontend), I recommend that
you get everything compiling and tests passing with the *previous*
commit before updating to this one.  It'll be easier to keep track of
what code is using the `DIDescriptor` hierarchy and what you've already
updated, and I think you're extremely unlikely to insert bugs.  YMMV of
course.

Back to *this* commit: I did this using the rename-md-di-nodes.sh
upgrade script I've attached to PR23080 (both code and testcases) and
filtered through clang-format-diff.py.  I edited the tests for
test/Assembler/invalid-generic-debug-node-*.ll by hand since the columns
were off-by-three.  It should work on your out-of-tree testcases (and
code, if you've followed the advice in the previous paragraph).

Some of the tests are in badly named files now (e.g.,
test/Assembler/invalid-mdcompositetype-missing-tag.ll should be
'dicompositetype'); I'll come back and move the files in a follow-up
commit.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236120 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-29 16:38:44 +00:00
Duncan P. N. Exon Smith
603fc8c265 docs: Update Kaleidoscope for recent DI changes
This has been bit-rotting, so fix it up.  I'll have to edit this again
once the MD* classes have been renamed to DI* -- I'll try to remember to
do that with the commit that renames them.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235244 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-18 00:01:35 +00:00
Ed Maste
ffc045ab80 Correct 'teh' and other typos / repeated words.
Patch by Eitan Adler.

Differential Revision:	http://reviews.llvm.org/D8514


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234939 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-14 20:52:58 +00:00
Sean Silva
06c06df4de [docs] Fix typo.
Based on a patch by Stanislav Manilov!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233771 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-31 22:48:45 +00:00
Sean Silva
b04877cae9 [docs] Fix some malformed links.
Patch by Stanislav Manilov!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232546 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-17 21:02:37 +00:00
David Blaikie
092251cccb Rename the 'Extending the Language: Debug Information' to 'Adding Debug Information' since this isn't actually modifying/extending the language.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228512 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-07 23:23:43 +00:00
Charlie Turner
c7efed60ef Fixup debug information references.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227020 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-24 21:51:21 +00:00
Charlie Turner
7f58cf305f Update references to lines of code count.
The number of lines of code in Kaleidoscope has risen from the
previously reported 700 to 986 according to the cloc tool. This tools
was run on the toy.cpp file from Chapter 8.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227019 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-24 21:51:17 +00:00
Eric Christopher
aa73f89bba The Kaleidoscope tutorial should be using "mcjit" for the library,
"jit" doesn't exist anymore.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225462 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-08 19:07:01 +00:00
Eric Christopher
772e538fb8 Add argument variable support to the debug info tutorial
and rearrange the prologue source location hack to immediately
after it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223725 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-09 00:28:24 +00:00
Eric Christopher
abe81e4794 Clean up the rst for the debug info tutorial
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223682 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-08 18:48:08 +00:00
Eric Christopher
23cf05ab9e Add Chapter 8 to the Kaleidoscope tutorial. This chapter adds
a description of how to add debug information using DWARF and
DIBuilder to the language.

Thanks to David Blaikie for his assistance with this tutorial.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223671 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-08 18:00:47 +00:00
Lang Hames
6c100e7428 [Docs][JIT] Update the clang++ invocation lines in the kaleidoscope docs.
The old examples had missing/incorrect flags that were causing failures on newer
versions of clang and the tutorial code.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221419 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-06 00:31:04 +00:00
Sean Silva
7a8ca279cd [docs] Clean up some more llvm-gcc stuff
Some references to llvm-gcc were so crusty that I wasn't sure how to
proceed and so I've left them intact.

I also slipped in a quick peephole fix to use a :doc: link instead of
raw HTML link.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@201619 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-19 00:12:34 +00:00
Peter Zotov
225146951e [OCaml] (PR10016) Add a few missing line in OCamlLangImpl2.rst
Original patch by Damien Schoof

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194067 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-05 12:14:04 +00:00
Sean Silva
d6e7daecf9 [docs] Fix broken link.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184514 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-21 01:11:52 +00:00
Logan Chien
2dce4f27ef Update code listings in LLVM tutorial.
Several LLVM headers are moved.  The code listings in
LLVM tutorial are not updated yet.

This CL removes the code replica in the .rst, and replace
them with a literalinclude directive, so that sphinx can
include the latest code automatically.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183607 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-08 09:03:03 +00:00
Nikola Smiljanic
f2403bbae6 Fix spelling
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@180843 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-01 13:05:43 +00:00
Sean Silva
6ccdfc54ba [docs] Remove explicit authorship.
In the spirit of r172109. Version control keeps a far more detailed
record of authorship anyways.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176807 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-11 16:25:16 +00:00
Sean Silva
d3afa9be99 docs: Update title of external tutorial.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173224 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-23 03:21:41 +00:00
Sean Silva
6fa16e192f docs: Move link to the new "external tutorials" area.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171154 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-27 08:57:08 +00:00
Sean Silva
d63c66890c docs: Add link to external LLVM backend tutorial.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170998 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-23 07:34:51 +00:00
Sean Silva
ee47edfd8e docs: Sphinxify docs/tutorial/
Sorry for the massive commit, but I just wanted to knock this one down
and it is really straightforward.

There are still a couple trivial (i.e. not related to the content)
things left to fix:

- Use of raw HTML links where :doc:`...` and :ref:`...` could be used
  instead. If you are a newbie and want to help fix this it would make
  for some good bite-sized patches; more experienced developers should
  be focusing on adding new content (to this tutorial or elsewhere, but
  please _do not_ waste your time on formatting when there is such dire
  need for documentation (see docs/SphinxQuickstartTemplate.rst to get
  started writing)).

- Highlighting of the kaleidoscope code blocks (currently left as bare
  `::`).  I will be working on writing a custom Pygments highlighter for
  this, mostly as training for maintaining the `llvm` code-block's lexer
  in-tree. I want to do this because I am extremely unhappy with how it
  just "gives up" on the slightest deviation from the expected syntax
  and leaves the whole code-block un-highlighted.

  More generally I am looking at writing some Sphinx extensions and
  keeping them in-tree as well, to support common use cases that
  currently have no good solution (like "monospace text inside a link").

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169343 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-05 00:26:32 +00:00
Sean Silva
91b9763d53 docs: Begin Sphinxification of docs/tutorial/
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169309 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-04 21:16:41 +00:00
Micah Villmow
791cfc211a Move TargetData to DataLayout.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165403 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-08 16:39:34 +00:00
Sylvestre Ledru
3f5054f922 Fix some minor typos
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161037 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-31 07:05:57 +00:00
Sylvestre Ledru
c8e41c5917 Fix a typo (the the => the)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160621 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-23 08:51:15 +00:00
Chandler Carruth
06cb8ed006 Move llvm/Support/IRBuilder.h -> llvm/IRBuilder.h
This was always part of the VMCore library out of necessity -- it deals
entirely in the IR. The .cpp file in fact was already part of the VMCore
library. This is just a mechanical move.

I've tried to go through and re-apply the coding standard's preferred
header sort, but at 40-ish files, I may have gotten some wrong. Please
let me know if so.

I'll be committing the corresponding updates to Clang and Polly, and
Duncan has DragonEgg.

Thanks to Bill and Eric for giving the green light for this bit of cleanup.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159421 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-29 12:38:19 +00:00
Daniel Dunbar
f2c696f016 [docs] Include the Kaleidescope tutorial in the Sphinx docs build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@156032 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-02 22:46:36 +00:00
Michael J. Spencer
75338097c7 Remove llvm-ld and llvm-stub (which is only used by llvm-ld).
llvm-ld is no longer useful and causes confusion and so it is being removed.

* Does not work very well on Windows because it must call a gcc like driver to
  assemble and link.
* Has lots of hard coded paths which are wrong on many systems.
* Does not understand most of ld's options.
* Can be partially replaced by llvm-link | opt | {llc | as, llc -filetype=obj} |
  ld, or fully replaced by Clang.

I know of no production use of llvm-ld, and hacking use should be
replaced by Clang's driver.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@155147 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-19 19:27:54 +00:00
Bill Wendling
9cabfa6842 Install the PNG file as well. PR4780.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142125 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-16 08:24:30 +00:00
Bill Wendling
545a2beb44 Update tutorial to reflect the current APIs. Also correct a small omission in
LangImpl6.html (it needed to defined the 'binary :' operator).
PR9052


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142123 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-16 08:06:54 +00:00
David Chisnall
c7d93bec47 Tell people using the tutorial how to make it actually work.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141103 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-04 19:36:30 +00:00
Eli Friedman
bc7d598cc1 A couple of minor fixes to the OCaml tutorial. PR10025 and PR10316. Patches by Damien Schoof!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135293 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-15 20:03:30 +00:00
NAKAMURA Takumi
f5af6ada3b docs: Introduce cascading style <div> and <p> continued on <h[2-5]>.
<h2>Section Example</h2>
<div> <!-- h2+div is applied -->
<p>Section preamble.</p>

<h3>Subsection Example</h3>
<p> <!-- h3+p is applied -->
Subsection body
</p>

<!-- End of section body -->
</div>

FIXME: Care H5 better.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130040 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-23 00:30:22 +00:00
NAKAMURA Takumi
05d0265fef docs: Use <Hn> as Heading elements instead of <DIV class="doc_foo">.
H1 ... doc_title
H2 ... doc_section
H3 ... doc_subsection
H4 ... doc_subsubsection

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129736 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-18 23:59:50 +00:00
NAKAMURA Takumi
4d6deb099e docs/*.html: Make W3C HTML 4.01 Strict more compliant.
FIXME: The logo handling in ReleaseNotes.html

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129208 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-09 09:51:57 +00:00
NAKAMURA Takumi
073d025816 docs/tutorial/OCamlLangImpl7.html: Fix a href to missing Chapter 8.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129183 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-09 02:14:41 +00:00
NAKAMURA Takumi
b9a33634cc docs: Canonicalize URLs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129181 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-09 02:13:37 +00:00
Jay Foad
3ecfc861b4 Remove PHINode::reserveOperandSpace(). Instead, add a parameter to
PHINode::Create() giving the (known or expected) number of operands.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128537 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-30 11:28:46 +00:00
Duncan Sands
60c8bf5350 Fix typo pointed out in pr9339.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126573 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-27 13:54:01 +00:00
Chris Lattner
155ced8092 Minor fixes to tutorial, patch by Benjamin Meyer!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125544 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-15 00:24:32 +00:00
Erick Tryzelaar
7a31865b1a Add a reference to the OCamlLangImpl8.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122651 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-01 03:29:25 +00:00
Erick Tryzelaar
160dae7d7f Add an OCaml tutorial page 8
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122650 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-01 03:27:43 +00:00
Dan Gohman
ab7fa0885e Fix missing includes of "llvm/Analysis/Passes.h" in the tutorials. Thanks
for Arnaud Allard de Grandmaison for preparing a patch.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119351 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-16 17:28:22 +00:00
Dan Gohman
dfa1a79b0c Update examples and documentation to explicitly add basicaa, now that it's
no longer included by default.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119169 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-15 18:41:10 +00:00
Chris Lattner
f57fcf7844 update the tutorial to use CreateFAdd to create fp operations.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112733 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-01 20:09:20 +00:00
Chris Lattner
6808cdc424 fix typos reported by Adam Warner!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106468 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-21 20:31:30 +00:00