summaryrefslogtreecommitdiff
path: root/docs/tutorial
diff options
context:
space:
mode:
authorLang Hames <lhames@gmail.com>2016-05-25 22:33:25 +0000
committerLang Hames <lhames@gmail.com>2016-05-25 22:33:25 +0000
commite48344195f79a7e417efa25ab3bd5e8fba063567 (patch)
tree757ed34a29d71ee53a2ee8deaa36db58ac238126 /docs/tutorial
parent088a773bb845ac88f6d842f47a8c2f6614a20cfb (diff)
[Kaleidoscope][BuildingAJIT] Fix code-block indents.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270782 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'docs/tutorial')
-rw-r--r--docs/tutorial/BuildingAJIT1.rst66
1 files changed, 33 insertions, 33 deletions
diff --git a/docs/tutorial/BuildingAJIT1.rst b/docs/tutorial/BuildingAJIT1.rst
index a169e2cf9a1..ca74c92bba6 100644
--- a/docs/tutorial/BuildingAJIT1.rst
+++ b/docs/tutorial/BuildingAJIT1.rst
@@ -76,13 +76,13 @@ will look like:
.. code-block:: c++
- std::unique_ptr<Module> M = buildModule();
- JIT J;
- Handle H = J.addModule(*M);
- int (*Main)(int, char*[]) =
- (int(*)(int, char*[])J.findSymbol("main").getAddress();
- int Result = Main();
- J.removeModule(H);
+ std::unique_ptr<Module> M = buildModule();
+ JIT J;
+ Handle H = J.addModule(*M);
+ int (*Main)(int, char*[]) =
+ (int(*)(int, char*[])J.findSymbol("main").getAddress();
+ int Result = Main();
+ J.removeModule(H);
The APIs that we build in these tutorials will all be variations on this simple
theme. Behind the API we will refine the implementation of the JIT to add
@@ -112,32 +112,32 @@ usual include guards and #includes [2]_, we get to the definition of our class:
.. code-block:: c++
- #ifndef LLVM_EXECUTIONENGINE_ORC_KALEIDOSCOPEJIT_H
- #define LLVM_EXECUTIONENGINE_ORC_KALEIDOSCOPEJIT_H
+ #ifndef LLVM_EXECUTIONENGINE_ORC_KALEIDOSCOPEJIT_H
+ #define LLVM_EXECUTIONENGINE_ORC_KALEIDOSCOPEJIT_H
- #include "llvm/ExecutionEngine/ExecutionEngine.h"
- #include "llvm/ExecutionEngine/RTDyldMemoryManager.h"
- #include "llvm/ExecutionEngine/Orc/CompileUtils.h"
- #include "llvm/ExecutionEngine/Orc/IRCompileLayer.h"
- #include "llvm/ExecutionEngine/Orc/LambdaResolver.h"
- #include "llvm/ExecutionEngine/Orc/ObjectLinkingLayer.h"
- #include "llvm/IR/Mangler.h"
- #include "llvm/Support/DynamicLibrary.h"
+ #include "llvm/ExecutionEngine/ExecutionEngine.h"
+ #include "llvm/ExecutionEngine/RTDyldMemoryManager.h"
+ #include "llvm/ExecutionEngine/Orc/CompileUtils.h"
+ #include "llvm/ExecutionEngine/Orc/IRCompileLayer.h"
+ #include "llvm/ExecutionEngine/Orc/LambdaResolver.h"
+ #include "llvm/ExecutionEngine/Orc/ObjectLinkingLayer.h"
+ #include "llvm/IR/Mangler.h"
+ #include "llvm/Support/DynamicLibrary.h"
- namespace llvm {
- namespace orc {
+ namespace llvm {
+ namespace orc {
- class KaleidoscopeJIT {
- private:
+ class KaleidoscopeJIT {
+ private:
- std::unique_ptr<TargetMachine> TM;
- const DataLayout DL;
- ObjectLinkingLayer<> ObjectLayer;
- IRCompileLayer<decltype(ObjectLayer)> CompileLayer;
+ std::unique_ptr<TargetMachine> TM;
+ const DataLayout DL;
+ ObjectLinkingLayer<> ObjectLayer;
+ IRCompileLayer<decltype(ObjectLayer)> CompileLayer;
- public:
+ public:
- typedef decltype(CompileLayer)::ModuleSetHandleT ModuleHandleT;
+ typedef decltype(CompileLayer)::ModuleSetHandleT ModuleHandleT;
Our class begins with four members: A TargetMachine, TM, which will be used
to build our LLVM compiler instance; A DataLayout, DL, which will be used for
@@ -162,13 +162,13 @@ this.
.. code-block:: c++
- KaleidoscopeJIT()
- : TM(EngineBuilder().selectTarget()), DL(TM->createDataLayout()),
- CompileLayer(ObjectLayer, SimpleCompiler(*TM)) {
- llvm::sys::DynamicLibrary::LoadLibraryPermanently(nullptr);
- }
+ KaleidoscopeJIT()
+ : TM(EngineBuilder().selectTarget()), DL(TM->createDataLayout()),
+ CompileLayer(ObjectLayer, SimpleCompiler(*TM)) {
+ llvm::sys::DynamicLibrary::LoadLibraryPermanently(nullptr);
+ }
- TargetMachine &getTargetMachine() { return *TM; }
+ TargetMachine &getTargetMachine() { return *TM; }
Next up we have our class constructor. We begin by initializing TM using the
EngineBuilder::selectTarget helper method, which constructs a TargetMachine for