Commit Graph

288 Commits

Author SHA1 Message Date
Hans Wennborg
c895f8c934 Fix missing arguments in tutorial
In tutorial "8. Kaleidoscope: Compiling to Object Code" a call to
TargetMachine->addPassesToEmitFile(pass, dest, FileType) is missing
nullptr as its 3rd value.

Patch by Sajjad Heydari!

Differential revision: https://reviews.llvm.org/D60369

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@358267 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-12 08:23:28 +00:00
Hans Wennborg
69455d8a78 try to fix the sphinx build some more
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@358156 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-11 07:46:25 +00:00
Hans Wennborg
4c129f6e6c Try to fix the shpinx build
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@358154 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-11 07:30:56 +00:00
Chris Lattner
2dd25b0413 last changes for now
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357868 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-07 14:34:24 +00:00
Chris Lattner
c599324ae4 various improvements in wording, also unbreak the bot
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357867 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-07 14:23:11 +00:00
Chris Lattner
a932c9ae0a make a bunch of cleanups in wording and tone
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357865 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-07 13:42:29 +00:00
Chris Lattner
e0a373b557 remove some unhelpful language from the tutorial
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357863 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-07 13:17:16 +00:00
Chris Lattner
b97b21f624 Copy the C++ kaleidoscope tutorial into a subdirectory and clean up various things, aligning with the direction of the WiCT workshop, and Meike Baumgärtner's view of how this should work. The old version of the documentation is unmodified, this is an experiment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357862 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-07 13:14:23 +00:00
Kristina Brooks
f960871b4b [Docs] Add note about legacy PM to Ch4 of tutorial
Add a note about legacy FunctionPassManager to the LLVM tutorial.

It seems to confuse some people, worth adding a warning to the tutorial
to elaborate and suggest using `llvm::legacy::FunctionPassManager` for
now. Not a perfect solution but hopefully will avoid confusion
in the meantime.

Differential Revision: https://reviews.llvm.org/D59258



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355930 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-12 15:44:18 +00:00
Wilfred Hughes
d218316be0 Fixed code snippet in Kaleidoscope tutorial to reflect final full code listing
Patch by Frank He.

Differential Revision: https://reviews.llvm.org/D52166


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354205 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-16 18:37:55 +00:00
Lang Hames
30b44ffb4c [BuildingAJIT] Clang-format chapters 1 and 2.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@346727 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-13 01:26:25 +00:00
Lang Hames
94419b4f02 [BuildingAJIT] Update chapter 2 to use the ORCv2 APIs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@346726 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-13 01:25:34 +00:00
Lang Hames
009a7621a3 [BuildingAJIT] Update the Ch1 KaleidoscopeJIT class to expose errors to clients.
Returning the error to clients provides an opportunity to introduce readers to
the Expected and Error APIs and makes the tutorial more useful as a starting
point for a real JIT class, while only slightly complicating the code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@344720 91177308-0d34-0410-b5e6-96231b3b80d8
2018-10-18 00:51:38 +00:00
Lang Hames
986e22dd7d [BuildingAJIT] Simplify a tutorial example and fix a syntax error.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@344712 91177308-0d34-0410-b5e6-96231b3b80d8
2018-10-17 22:27:09 +00:00
Lang Hames
8728549da3 [BuildingAJIT] Fix a function signature in the documentation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@344705 91177308-0d34-0410-b5e6-96231b3b80d8
2018-10-17 19:35:38 +00:00
Lang Hames
73405ef163 [BuildingAJIT] Update chapter 1 to use the ORCv2 APIs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@344667 91177308-0d34-0410-b5e6-96231b3b80d8
2018-10-17 03:34:09 +00:00
Stephane Sezer
d60939522e [docs] Fix a typo in KaleidoscopeJIT tutorial
Summary: Just a missing end quote.

Reviewers: lhames

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D46136

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@331794 91177308-0d34-0410-b5e6-96231b3b80d8
2018-05-08 18:43:27 +00:00
Nico Weber
63033d33c8 s/LLVM_ON_WIN32/_WIN32/, llvm
LLVM_ON_WIN32 is set exactly with MSVC and MinGW (but not Cygwin) in
HandleLLVMOptions.cmake, which is where _WIN32 defined too.  Just use the
default macro instead of a reinvented one.

See thread "Replacing LLVM_ON_WIN32 with just _WIN32" on llvm-dev and cfe-dev.
No intended behavior change.

This moves over all uses of the macro, but doesn't remove the definition
of it in (llvm-)config.h yet.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@331127 91177308-0d34-0410-b5e6-96231b3b80d8
2018-04-29 00:45:03 +00:00
Sjoerd Meijer
5e6fce1693 [Kaleidoscope] Tiny typo fixes
Fixes for "lets" references which should be "let's" in the Kaleidoscope
tutorial.

Patch by: Robin Dupret

Differential Revision: https://reviews.llvm.org/D44990


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@328772 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-29 12:31:06 +00:00
Sjoerd Meijer
3f8e03ebb0 [Kaleidoscope] doc fix
This fixes the compile command of the example in Chapter 2.

Differential Revision: https://reviews.llvm.org/D43196


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@327989 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-20 15:37:15 +00:00
Lang Hames
a0fdd1603b [docs] Add out-of-date warnings to the BuildingAJIT tutorial text.
The text will be updated once the ORC API churn dies down.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@324406 91177308-0d34-0410-b5e6-96231b3b80d8
2018-02-06 21:25:20 +00:00
Hiroshi Inoue
d1b456b6d1 [NFC] fix trivial typos in comments and documents
"to to" -> "to"



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@323628 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-29 05:17:03 +00:00
Hiroshi Inoue
8040eab589 [NFC] fix trivial typos in comments and documents
"in in" -> "in", "on on" -> "on" etc.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@323508 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-26 08:15:29 +00:00
Hiroshi Inoue
f90f551998 [NFC] fix trivial typos in documents
"the the" -> "the"



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@322552 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-16 13:19:48 +00:00
David Blaikie
86e7a0583d PR35705: Fix Chapter 9 example code for API changes to DIBuilder
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321214 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-20 19:36:54 +00:00
Don Hinton
95ed232373 [ORC][Kaleidoscope] Update ORCJit tutorial.
Summary: Fix a few typos and update names to match current source.

Differential Revision: https://reviews.llvm.org/D37948

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313473 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-17 00:24:43 +00:00
Lang Hames
a7007af1c7 [ORC][Kaleidoscope] Update Chapter 1 of BuildingAJIT to incorporate recent ORC
API changes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310947 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-15 19:20:10 +00:00
Kirill Bobyrev
d6a9e4a5f3 [docs] NFC: Fix links in the tutorial
r274441 introduced Chapter 10 of "Implementing a Language with LLVM" tutorial,
which caused all files in the tutorial to start using two digit numbering. But
many links were not changed and therefore appear to be broken. This patch
addresses described issue.

As a result, following command does not produce any output anymore:

$ grep -nR '<LangImpl[0-9].html>' ./docs/tutorial/


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307525 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-10 09:07:23 +00:00
Sylvestre Ledru
99aada9bea Remove redundant code block and update comment.
By patch zoren here: https://github.com/llvm-mirror/llvm/pull/20



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296968 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-04 14:00:44 +00:00
Mehdi Amini
e0ae1eda9c Update Kaleidoscope tutorial and improve Windows support
Many quoted code blocks were not in sync with the actual toy.cpp
files. Improve tutorial text slightly in several places.
Added some step descriptions crucial to avoid crashes (like
InitializeNativeTarget* calls).
Solve/workaround problems with Windows (JIT'ed method not found, using
custom and standard library functions from host process).

Patch by: Moritz Kroll <moritz.kroll@gmx.de>

Differential Revision: https://reviews.llvm.org/D29864

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@294870 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-11 21:26:52 +00:00
Matthias Braun
d6da5dbf7b Use print() instead of dump() in code
The dump() functions are meant to be used in a debugger, code should
typically use something like print(errs());

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@293365 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-28 02:47:46 +00:00
Davide Italiano
6a92b76991 [Docs] Fix a broken link in the Kaleidoscope tutorial.
Patch by:	Alfred Perlstein <alfred@FreeBSD.org>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281297 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-13 06:31:37 +00:00
Sylvestre Ledru
297f179ffa Fix some typos in the doc
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@279943 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-28 20:29:18 +00:00
Lang Hames
32217d6ae4 [BuildingAJIT] Fix a couple of typos in the Chapter 3 draft.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278033 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-08 18:09:56 +00:00
Lang Hames
075c1e2e1a [ExecutionEngine][MCJIT][Orc] Replace RuntimeDyld::SymbolInfo with JITSymbol.
This patch replaces RuntimeDyld::SymbolInfo with JITSymbol: A symbol class
that is capable of lazy materialization (i.e. the symbol definition needn't be
emitted until the address is requested). This can be used to support common
and weak symbols in the JIT (though this is not implemented in this patch).

For consistency, RuntimeDyld::SymbolResolver is renamed to JITSymbolResolver.

For space efficiency a new class, JITEvaluatedSymbol, is introduced that
behaves like the old RuntimeDyld::SymbolInfo - i.e. it is just a pair of an
address and symbol flags. Instances of JITEvaluatedSymbol can be used in
symbol-tables to avoid paying the space cost of the materializer.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277386 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-01 20:49:11 +00:00
Lang Hames
5a04b09d43 [Kaleidoscope][BuildingAJIT] More work on the text for Chapter 3.
Add an overview of stubs and compile callbacks before the discussion of the
source changes.

-- This line, and those below, will be ignored--

M    docs/tutorial/BuildingAJIT3.rst


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275933 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-19 00:25:52 +00:00
Alexander Kornienko
46f9c274d1 Fixed errors in docs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275789 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-18 14:13:18 +00:00
Lang Hames
8e1c20f813 [Kaleidoscope][BuildingAJIT] Start filling in text for chapter 3.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275518 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-15 01:39:49 +00:00
Sylvestre Ledru
e0f2f6011e fix some various typos in the doc
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274449 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-02 19:28:40 +00:00
Wilfred Hughes
f9c643b6e0 New Kaleidoscope chapter: Creating object files
This new chapter describes compiling LLVM IR to object files.

The new chaper is chapter 8, so later chapters have been renumbered.
Since this brings us to 10 chapters total, I've also needed to rename
the other chapters to use two digit numbering.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274441 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-02 17:01:59 +00:00
Lang Hames
6c2d562b4c [Kaleidoscope][BuildingAJIT] Remove some superfluous commas in Chapter 2.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273184 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-20 18:37:52 +00:00
Lang Hames
4cf102de04 [Kaleidoscope][BuildingAJIT] Fix a punctuation mistake in Chapter 2.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273183 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-20 18:34:46 +00:00
David Majnemer
0c4f69f653 Remove the ScalarReplAggregates pass
Nearly all the changes to this pass have been done while maintaining and
updating other parts of LLVM.  LLVM has had another pass, SROA, which
has superseded ScalarReplAggregates for quite some time.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272737 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-15 00:19:09 +00:00
Hans Wennborg
e09bd44a40 Fix some typos in the Kaleidoscope tutorial (PR28120)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272681 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-14 16:05:12 +00:00
Lang Hames
8abe734181 [Kaleidoscope] Update Chapter 3 of the "Implementing a Language" tutorial to
take into account modernizations in r246002 and r270381.

Patch based on http://reviews.llvm.org/D20954 by Miroslav Hrncir.
Thanks Miroslav!



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271985 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-07 05:40:08 +00:00
Lang Hames
eaf5ddfe77 [Kaleidoscope][BuildingAJIT] Fix hyphenation in chapter 2 title.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271924 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-06 18:35:44 +00:00
Lang Hames
5d3458a04a [Kaleidoscope][BuildingAJIT] More cleanup of Chapter 2.
Streamline some wording, fix a bug in the markup for the layer interface table.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271917 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-06 18:22:47 +00:00
Lang Hames
bae1eaf5d8 [Kaleidoscope][BuildingAJIT] Clean up sentence, remove comments from code block.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271913 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-06 18:07:23 +00:00
Lang Hames
30bfbc3566 [Kaleidoscope][BuildingAJIT] Split up the code-block describing the substitution
of OptimizeLayer for CompileLayer in Chapter 2.

Hopefully this will read a little more clearly.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271868 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-06 05:07:52 +00:00
Lang Hames
01157841a3 [Kaleidoscope][BuildingAJIT] Fix code-blocks in Chapter 2.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271867 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-06 04:53:59 +00:00