Commit Graph

277 Commits

Author SHA1 Message Date
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
Lang Hames
608095db1c [Kaleidoscope][BuildingAJIT] Add tutorial text for Chapter 2.
This chapter discusses IR optimizations, the ORC IRTransformLayer, and the ORC
layer concept itself.

The text is still pretty rough, but I think the main ideas are there. Feedback
is very welcome, as always.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271865 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-06 03:28:12 +00:00
Lang Hames
1fa1983597 [Orc] Add conversion to/from RuntimeDyld::SymbolInfo for JITSymbol.
This tidies up some code that was manually constructing RuntimeDyld::SymbolInfo
instances from JITSymbols. It will save more mess in the future when
JITSymbol::getAddress is extended to return an Expected<TargetAddress> rather
than just a TargetAddress, since we'll be able to embed the error checking in
the conversion.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271350 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-31 23:14:26 +00:00
Lang Hames
9dd9c9cfcb [Kaleidoscope][BuildingAJIT] Finish off Chapter 1.
* Various tidy-up and streamlining of existing discussion.
* Describes findSymbol and removeModule.

Chapter 1 is now rough but essentially complete in terms of content.

Feedback, patches etc. very welcome.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271225 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-30 19:03:26 +00:00
Lang Hames
f43e7e48eb [Kaleidoscope][BuildingAJIT] Add stub Chapter 5 text.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271213 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-30 16:53:19 +00:00
Lang Hames
7ac928f303 [Kaleidoscope][BuildingAJIT] Add stub chapter text for Building A JIT Chapter 4.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271064 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-27 22:34:56 +00:00
Lang Hames
26ec8e8a3d [Kaleidoscope][BuildingAJIT] Fix strong emphasis markup by removing whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270918 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-26 21:21:18 +00:00
Lang Hames
71d351f50d [Kaleidoscope][BuildingAJIT] Add docs for Chapter 3 of the Building A JIT
tutorial.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270917 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-26 21:17:06 +00:00
Lang Hames
df5dfe2a2e [Kaleidoscope][BuildingAJIT] Add a stub Chapter 2 doc.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270809 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-26 00:38:04 +00:00
Lang Hames
630552d242 [KaleidoscopeJIT][BuildingAJIT] Remove some copy-pasta from Chapter 1.
This text was accidentally left in when the original document was copied from
Chapter 7 of the Kaleidoscope language series.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270799 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-25 23:42:48 +00:00
Lang Hames
bdbb8ee4ab [Kaleidoscope][BuildingAJIT] Shorten the name of the BuildingAJIT tutorial
series.

The original name was pretty long, and likely to look awkward as more
chapters get added.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270796 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-25 23:34:19 +00:00
Lang Hames
e48344195f [Kaleidoscope][BuildingAJIT] Fix code-block indents.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270782 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-25 22:33:25 +00:00